pub trait Executor<C>
where C: Clone + Debug + PartialEq + JsonSchema + 'static,
{ // Required method fn execute( &mut self, sender: Addr, msg: CosmosMsg<C> ) -> AnyResult<AppResponse>; // Provided methods fn instantiate_contract<T: Serialize, U: Into<String>>( &mut self, code_id: u64, sender: Addr, init_msg: &T, send_funds: &[Coin], label: U, admin: Option<String> ) -> AnyResult<Addr> { ... } fn execute_contract<T: Serialize + Debug>( &mut self, sender: Addr, contract_addr: Addr, msg: &T, send_funds: &[Coin] ) -> AnyResult<AppResponse> { ... } fn migrate_contract<T: Serialize>( &mut self, sender: Addr, contract_addr: Addr, msg: &T, new_code_id: u64 ) -> AnyResult<AppResponse> { ... } fn send_tokens( &mut self, sender: Addr, recipient: Addr, amount: &[Coin] ) -> AnyResult<AppResponse> { ... } }

Required Methods§

source

fn execute(&mut self, sender: Addr, msg: CosmosMsg<C>) -> AnyResult<AppResponse>

Runs arbitrary CosmosMsg. This will create a cache before the execution, so no state changes are persisted if this returns an error, but all are persisted on success.

Provided Methods§

source

fn instantiate_contract<T: Serialize, U: Into<String>>( &mut self, code_id: u64, sender: Addr, init_msg: &T, send_funds: &[Coin], label: U, admin: Option<String> ) -> AnyResult<Addr>

Create a contract and get the new address. This is just a helper around execute()

source

fn execute_contract<T: Serialize + Debug>( &mut self, sender: Addr, contract_addr: Addr, msg: &T, send_funds: &[Coin] ) -> AnyResult<AppResponse>

Execute a contract and process all returned messages. This is just a helper around execute(), but we parse out the data field to that what is returned by the contract (not the protobuf wrapper)

source

fn migrate_contract<T: Serialize>( &mut self, sender: Addr, contract_addr: Addr, msg: &T, new_code_id: u64 ) -> AnyResult<AppResponse>

Migrate a contract. Sender must be registered admin. This is just a helper around execute()

source

fn send_tokens( &mut self, sender: Addr, recipient: Addr, amount: &[Coin] ) -> AnyResult<AppResponse>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT> Executor<<CustomT as Module>::ExecT> for App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
where CustomT::ExecT: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static, CustomT::QueryT: CustomQuery + DeserializeOwned + 'static, WasmT: Wasm<CustomT::ExecT, CustomT::QueryT>, BankT: Bank, ApiT: Api, StorageT: Storage, CustomT: Module, StakingT: Staking, DistrT: Distribution, IbcT: Ibc, GovT: Gov, StargateT: Stargate,