From b8acfedf50f112cd25ef3de31629910719fac0df Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 13 Jan 2021 13:34:06 +0100 Subject: [PATCH 1/2] Add Ics20Transfer to IbcMsg --- packages/std/src/ibc.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index c511456ecd..8112d72e76 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -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; @@ -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. From baf6f9cd32418632572a3c844db5c3cd0328f129 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 13 Jan 2021 13:36:43 +0100 Subject: [PATCH 2/2] Ensure stargate code is tested in the CI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b9f83afd9..2d2ac008d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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