Struct cw_multi_test::App [−][src]
pub struct App<Bank = BankKeeper, Api = MockApi, Storage = MockStorage, Custom = FailingModule<Empty, Empty, Empty>, Wasm = WasmKeeper<Empty, Empty>, Staking = FailingStaking, Distr = FailingDistribution> { /* fields omitted */ }
Expand description
Router is a persisted state. You can query this. Execution generally happens on the RouterCache, which then can be atomically committed or rolled back. We offer .execute() as a wrapper around cache, execute, commit/rollback process.
Implementations
impl App<BankKeeper, MockApi, MemoryStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, FailingModule<StakingMsg, StakingQuery, StakingSudo>, FailingModule<DistributionMsg, Empty, Empty>>
impl App<BankKeeper, MockApi, MemoryStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, FailingModule<StakingMsg, StakingQuery, StakingSudo>, FailingModule<DistributionMsg, Empty, Empty>>
pub fn new<F>(init_fn: F) -> Self where
F: FnOnce(&mut Router<BankKeeper, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, FailingStaking, FailingDistribution>, &dyn Api, &mut dyn Storage),
pub fn new<F>(init_fn: F) -> Self where
F: FnOnce(&mut Router<BankKeeper, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, FailingStaking, FailingDistribution>, &dyn Api, &mut dyn Storage),
Creates new default App
implementation working with Empty custom messages.
pub fn init_modules<F, T>(&mut self, init_fn: F) -> T where
F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT>, &dyn Api, &mut dyn Storage) -> T,
impl<BankT, ApiT, StorageT, CustomT, StakingT, DistrT> App<BankT, ApiT, StorageT, CustomT, WasmKeeper<CustomT::ExecT, CustomT::QueryT>, StakingT, DistrT> where
BankT: Bank,
ApiT: Api,
StorageT: Storage,
CustomT: Module,
StakingT: Staking,
DistrT: Distribution,
CustomT::ExecT: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static,
CustomT::QueryT: CustomQuery + DeserializeOwned + 'static,
impl<BankT, ApiT, StorageT, CustomT, StakingT, DistrT> App<BankT, ApiT, StorageT, CustomT, WasmKeeper<CustomT::ExecT, CustomT::QueryT>, StakingT, DistrT> where
BankT: Bank,
ApiT: Api,
StorageT: Storage,
CustomT: Module,
StakingT: Staking,
DistrT: Distribution,
CustomT::ExecT: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static,
CustomT::QueryT: CustomQuery + DeserializeOwned + 'static,
This registers contract code (like uploading wasm bytecode on a chain), so it can later be used to instantiate a contract.
This allows to get ContractData
for specific contract
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> where
CustomT::ExecT: Debug + PartialEq + Clone + 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,
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> where
CustomT::ExecT: Debug + PartialEq + Clone + 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,
Returns a copy of the current block_info
Simple helper so we get access to all the QuerierWrapper helpers, eg. wrap().query_wasm_smart, query_all_balances, …
pub fn execute_multi(
&mut self,
sender: Addr,
msgs: Vec<CosmosMsg<CustomT::ExecT>>
) -> AnyResult<Vec<AppResponse>>
pub fn execute_multi(
&mut self,
sender: Addr,
msgs: Vec<CosmosMsg<CustomT::ExecT>>
) -> AnyResult<Vec<AppResponse>>
Runs multiple CosmosMsg in one atomic operation. This will create a cache before the execution, so no state changes are persisted if any of them return an error. But all writes are persisted on success.
Call a smart contract in “sudo” mode. 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.
Runs arbitrary SudoMsg. 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.
Trait Implementations
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> Executor<<CustomT as Module>::ExecT> for App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> 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,
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> Executor<<CustomT as Module>::ExecT> for App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> 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,
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. Read more
Create a contract and get the new address. This is just a helper around execute() Read more
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) Read more
fn migrate_contract<T: Serialize>(
&mut self,
sender: Addr,
contract_addr: Addr,
msg: &T,
new_code_id: u64
) -> AnyResult<AppResponse>
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() Read more
fn send_tokens(
&mut self,
sender: Addr,
recipient: Addr,
amount: &[Coin]
) -> AnyResult<AppResponse>
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> Querier for App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> 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,
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> Querier for App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT> 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,
raw_query is all that must be implemented for the Querier. This allows us to pass through binary queries from one level to another without knowing the custom format, or we can decode it, with the knowledge of the allowed types. People using the querier probably want one of the simpler auto-generated helper methods Read more