pub trait HandleCallback: Serialize {
const BLOCK_SIZE: usize;
// Provided method
fn to_cosmos_msg(
&self,
code_hash: String,
contract_addr: String,
funds_amount: Option<Uint128>,
) -> StdResult<CosmosMsg> { ... }
}
Expand description
A trait marking types that define the handle message(s) of a contract
This trait requires specifying a padding block size and provides a method to create the CosmosMsg used to execute a handle method of a contract
Required Associated Constants§
Sourceconst BLOCK_SIZE: usize
const BLOCK_SIZE: usize
pad the message to blocks of this size
Provided Methods§
Sourcefn to_cosmos_msg(
&self,
code_hash: String,
contract_addr: String,
funds_amount: Option<Uint128>,
) -> StdResult<CosmosMsg>
fn to_cosmos_msg( &self, code_hash: String, contract_addr: String, funds_amount: Option<Uint128>, ) -> StdResult<CosmosMsg>
Returns StdResult
Tries to convert the instance of the implementing type to a CosmosMsg that will trigger a handle function of a contract. The BLOCK_SIZE specified in the implementation is used when padding the message
§Arguments
code_hash
- String holding the code hash of the contract to be executedcontract_addr
- address of the contract being calledfunds_amount
- Optional Uint128 amount of native coin to send with the handle message
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.