InitCallback

Trait InitCallback 

Source
pub trait InitCallback: Serialize {
    const BLOCK_SIZE: usize;

    // Provided method
    fn to_cosmos_msg(
        &self,
        admin: Option<String>,
        label: String,
        code_id: u64,
        code_hash: String,
        funds_amount: Option<Uint128>,
    ) -> StdResult<CosmosMsg> { ... }
}
Expand description

A trait marking types that define the instantiation message of a contract

This trait requires specifying a padding block size and provides a method to create the CosmosMsg used to instantiate a contract

Required Associated Constants§

Source

const BLOCK_SIZE: usize

pad the message to blocks of this size

Provided Methods§

Source

fn to_cosmos_msg( &self, admin: Option<String>, label: String, code_id: u64, code_hash: String, funds_amount: Option<Uint128>, ) -> StdResult<CosmosMsg>

Returns StdResult

Tries to convert the instance of the implementing type to a CosmosMsg that will trigger the instantiation of a contract. The BLOCK_SIZE specified in the implementation is used when padding the message

§Arguments
  • label - String holding the label for the new contract instance
  • code_id - code ID of the contract to be instantiated
  • code_hash - String holding the code hash of the contract to be instantiated
  • funds_amount - Optional Uint128 amount of native coin to send with instantiation 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.

Implementors§