Skip to content

Commit

Permalink
Merge pull request #710 from CosmWasm/ibc-transfer-msg
Browse files Browse the repository at this point in the history
Add IbcSend message type to stargate code
  • Loading branch information
ethanfrey authored Jan 13, 2021
2 parents 5dd4e61 + baf6f9c commit 942f389
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ jobs:
- run:
name: Build library for native target (all features)
working_directory: ~/project/packages/std
command: cargo build --locked --features iterator,staking
command: cargo build --locked --features iterator,staking,stargate
- run:
name: Build library for wasm target (all features)
working_directory: ~/project/packages/std
command: cargo wasm --locked --features iterator,staking
command: cargo wasm --locked --features iterator,staking,stargate
- run:
name: Run unit tests (all features)
working_directory: ~/project/packages/std
command: cargo test --locked --features iterator,staking
command: cargo test --locked --features iterator,staking,stargate
- run:
name: Build and run schema generator
working_directory: ~/project/packages/std
Expand Down
16 changes: 16 additions & 0 deletions packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::fmt;

use crate::addresses::HumanAddr;
use crate::binary::Binary;
use crate::coins::Coin;
use crate::results::{Attribute, CosmosMsg};
use crate::types::Empty;

Expand All @@ -15,6 +17,20 @@ use crate::types::Empty;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum IbcMsg {
/// Sends bank tokens owned by the contract to the given address on another chain.
/// The channel must already be established between the ibctransfer module on this chain
/// and a matching module on the remote chain.
/// We cannot select the port_id, this is whatever the local chain has bound the ibctransfer
/// module to.
Ics20Transfer {
/// exisiting channel to send the tokens over
channel_id: String,
/// address on the remote chain to receive these tokens
to_address: HumanAddr,
/// packet data only supports one coin
/// https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20
amount: Coin,
},
/// 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.
Expand Down

0 comments on commit 942f389

Please sign in to comment.