Trait cw_multi_test::CosmosRouter

source ·
pub trait CosmosRouter {
    type ExecC: CustomMsg;
    type QueryC: CustomQuery;

    // Required methods
    fn execute(
        &self,
        api: &dyn Api,
        storage: &mut dyn Storage,
        block: &BlockInfo,
        sender: Addr,
        msg: CosmosMsg<Self::ExecC>
    ) -> AnyResult<AppResponse>;
    fn query(
        &self,
        api: &dyn Api,
        storage: &dyn Storage,
        block: &BlockInfo,
        request: QueryRequest<Self::QueryC>
    ) -> AnyResult<Binary>;
    fn sudo(
        &self,
        api: &dyn Api,
        storage: &mut dyn Storage,
        block: &BlockInfo,
        msg: SudoMsg
    ) -> AnyResult<AppResponse>;
}
Expand description

A trait representing the Cosmos based chain’s router.

This trait is designed for routing messages within the Cosmos ecosystem. It is key to ensure that transactions and contract calls are directed to the correct destinations during testing, simulating real-world blockchain operations.

Required Associated Types§

source

type ExecC: CustomMsg

Type of the executed custom message.

source

type QueryC: CustomQuery

Type of the query custom message.

Required Methods§

source

fn execute( &self, api: &dyn Api, storage: &mut dyn Storage, block: &BlockInfo, sender: Addr, msg: CosmosMsg<Self::ExecC> ) -> AnyResult<AppResponse>

Executes messages.

source

fn query( &self, api: &dyn Api, storage: &dyn Storage, block: &BlockInfo, request: QueryRequest<Self::QueryC> ) -> AnyResult<Binary>

Evaluates queries.

source

fn sudo( &self, api: &dyn Api, storage: &mut dyn Storage, block: &BlockInfo, msg: SudoMsg ) -> AnyResult<AppResponse>

Evaluates privileged actions.

Implementors§

source§

impl<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT> CosmosRouter for Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
where CustomT::ExecT: CustomMsg + DeserializeOwned + 'static, CustomT::QueryT: CustomQuery + DeserializeOwned + 'static, CustomT: Module, WasmT: Wasm<CustomT::ExecT, CustomT::QueryT>, BankT: Bank, StakingT: Staking, DistrT: Distribution, IbcT: Ibc, GovT: Gov, StargateT: Stargate,

§

type ExecC = <CustomT as Module>::ExecT

§

type QueryC = <CustomT as Module>::QueryT