Struct cw_multi_test::WasmKeeper
source · pub struct WasmKeeper<ExecC, QueryC> { /* private fields */ }
Implementations§
source§impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>
impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>
source§impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>where
ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static,
QueryC: CustomQuery + DeserializeOwned + 'static,
impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>where ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static,
pub fn new() -> Self
pub fn new_with_custom_address_generator( generator: impl AddressGenerator + 'static ) -> Self
pub fn query_smart( &self, address: Addr, api: &dyn Api, storage: &dyn Storage, querier: &dyn Querier, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Binary>
pub fn query_raw( &self, address: Addr, storage: &dyn Storage, key: &[u8] ) -> Binary
sourcepub fn register_contract(
&self,
storage: &mut dyn Storage,
code_id: usize,
creator: Addr,
admin: impl Into<Option<Addr>>,
label: String,
created: u64
) -> AnyResult<Addr>
pub fn register_contract( &self, storage: &mut dyn Storage, code_id: usize, creator: Addr, admin: impl Into<Option<Addr>>, label: String, created: u64 ) -> AnyResult<Addr>
This just creates an address and empty storage instance, returning the new address You must call init after this to set up the contract properly. These are separated into two steps to have cleaner return values.
pub fn call_execute( &self, api: &dyn Api, storage: &mut dyn Storage, address: Addr, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>
pub fn call_instantiate( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>
pub fn call_reply( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, reply: Reply ) -> AnyResult<Response<ExecC>>
pub fn call_sudo( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>
pub fn call_migrate( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>
pub fn save_contract( &self, storage: &mut dyn Storage, address: &Addr, contract: &ContractData ) -> AnyResult<()>
Trait Implementations§
source§impl<ExecC, QueryC> Default for WasmKeeper<ExecC, QueryC>
impl<ExecC, QueryC> Default for WasmKeeper<ExecC, QueryC>
source§impl<ExecC, QueryC> Wasm<ExecC, QueryC> for WasmKeeper<ExecC, QueryC>where
ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static,
QueryC: CustomQuery + DeserializeOwned + 'static,
impl<ExecC, QueryC> Wasm<ExecC, QueryC> for WasmKeeper<ExecC, QueryC>where ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static,
source§fn query(
&self,
api: &dyn Api,
storage: &dyn Storage,
querier: &dyn Querier,
block: &BlockInfo,
request: WasmQuery
) -> AnyResult<Binary>
fn query( &self, api: &dyn Api, storage: &dyn Storage, querier: &dyn Querier, block: &BlockInfo, request: WasmQuery ) -> AnyResult<Binary>
Handles all WasmQuery requests