Skip to content

Commit

Permalink
Add IbcSend message type to stargate code
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jan 12, 2021
1 parent 969bb8b commit 58d33dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/std/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub enum QueryRequest<C: CustomQuery> {
Bank(BankQuery),
Custom(C),
Staking(StakingQuery),
Wasm(WasmQuery),
/// A Stargate query encoded the same way as abci_query, with path and protobuf encoded Data.
/// The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md)
/// The response is also protobuf encoded. The caller is responsible for compiling the proper protobuf definitions
Expand All @@ -24,7 +25,6 @@ pub enum QueryRequest<C: CustomQuery> {
/// this is the expected protobuf message type (not any), binary encoded
data: Binary,
},
Wasm(WasmQuery),
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
Expand Down
17 changes: 16 additions & 1 deletion packages/std/src/results/cosmos_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,29 @@ where
// to call into more app-specific code (whatever they define)
Custom(T),
Staking(StakingMsg),
Wasm(WasmMsg),
/// A Stargate message encoded the same way as a protobof [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto).
/// This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)
#[cfg(feature = "stargate")]
Stargate {
type_url: String,
data: Binary,
},
Wasm(WasmMsg),
/// Sends *native 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.
#[cfg(feature = "stargate")]
IbcSend {
/// 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/master/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20
amount: Coin,
},
}

/// The message types of the bank module.
Expand Down

0 comments on commit 58d33dd

Please sign in to comment.