message: Add new ibc message type
diff: @@ -26,6 +26,8 @@ where
  type_url: String,
  data: Binary,
  },
  + #[cfg(feature = "stargate")]
  + Ibc(IbcMsg),
  Wasm(WasmMsg),
  }
  @@ -105,6 +107,28 @@ pub enum WasmMsg {
  },
  }
  +/// These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts
  +/// (contracts that directly speak the IBC protocol via 6 entry points)
  +#[cfg(feature = "stargate")]
  +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
  +#[serde(rename_all = "snake_case")]
  +pub enum IbcMsg {
  + /// Sends an IBC packet with given data over the existing channel.
  + /// Data should be encoded in a format defined by the channel version,
  + /// and the module on the other side should know how to parse this.
  + SendPacket {
  + channel_id: String,
  + data: Binary,
  + timeout_height: u64,
  + version: u64,
  + },
  + /// This will close an existing channel that is owned by this contract.
  + /// Port is auto-assigned to the contracts' ibc port
  + CloseChannel {
  + channel_id: String,
  + }
  +}
  +
  impl<T: Clone + fmt::Debug + PartialEq + JsonSchema> From<BankMsg> for CosmosMsg<T> {
  fn from(msg: BankMsg) -> Self {
  CosmosMsg::Bank(msg)
  @@ -124,6 +148,13 @@ impl<T: Clone + fmt::Debug + PartialEq + JsonSchema> From<WasmMsg> for CosmosMsg
  }
  }
  +#[cfg(feature = "stargate")]
  +impl<T: Clone + fmt::Debug + PartialEq + JsonSchema> From<IbcMsg> for CosmosMsg<T> {
  + fn from(msg: IbcMsg) -> Self {
  + CosmosMsg::Ibc(msg)
  + }
  +}
  +
  #[cfg(test)]
  mod tests {
  use super::*;
  