Struct cw_multi_test::App [−][src]
pub struct App<C = Empty> where
C: Clone + Debug + PartialEq + JsonSchema + 'static, { /* 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.
C is the custom message returned init, handle, sudo (Response
Implementations
pub fn new(
api: impl Api + 'static,
block: BlockInfo,
bank: impl Bank + 'static,
storage: impl Storage + 'static
) -> Self
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<C>>
) -> Result<Vec<AppResponse>, String>
pub fn execute_multi(
&mut self,
sender: Addr,
msgs: Vec<CosmosMsg<C>>
) -> Result<Vec<AppResponse>, String>
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.
This is an “admin” function to let us adjust bank accounts
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
Trait Implementations
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() Read more
fn migrate_contract<T: Serialize>(
&mut self,
sender: Addr,
contract_addr: Addr,
msg: &T,
new_code_id: u64
) -> Result<AppResponse, String>
fn migrate_contract<T: Serialize>(
&mut self,
sender: Addr,
contract_addr: Addr,
msg: &T,
new_code_id: u64
) -> Result<AppResponse, String>
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]
) -> Result<AppResponse, String>
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