Struct sg_multi_test::StargazeApp
source · pub struct StargazeApp(_);Implementations§
source§impl StargazeApp
impl StargazeApp
Methods from Deref<Target = App<BankKeeper, MockApi, MockStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>>>§
pub fn init_modules<F, T>(&mut self, init_fn: F) -> Twhere
F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &mut dyn Storage) -> T,
pub fn read_module<F, T>(&self, query_fn: F) -> Twhere
F: FnOnce(&Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &dyn Storage) -> T,
sourcepub fn store_code(
&mut self,
code: Box<dyn Contract<<CustomT as Module>::ExecT, <CustomT as Module>::QueryT> + 'static, Global>
) -> u64
pub fn store_code(
&mut self,
code: Box<dyn Contract<<CustomT as Module>::ExecT, <CustomT as Module>::QueryT> + 'static, Global>
) -> u64
This registers contract code (like uploading wasm bytecode on a chain), so it can later be used to instantiate a contract.
sourcepub fn contract_data(&self, address: &Addr) -> Result<ContractData, Error>
pub fn contract_data(&self, address: &Addr) -> Result<ContractData, Error>
This allows to get ContractData for specific contract
pub fn set_block(&mut self, block: BlockInfo)
pub fn update_block<F>(&mut self, action: F)where
F: Fn(&mut BlockInfo),
sourcepub fn block_info(&self) -> BlockInfo
pub fn block_info(&self) -> BlockInfo
Returns a copy of the current block_info
sourcepub fn wrap(&self) -> QuerierWrapper<'_, <CustomT as Module>::QueryT>
pub fn wrap(&self) -> QuerierWrapper<'_, <CustomT as Module>::QueryT>
Simple helper so we get access to all the QuerierWrapper helpers, eg. wrap().query_wasm_smart, query_all_balances, …
sourcepub fn execute_multi(
&mut self,
sender: Addr,
msgs: Vec<CosmosMsg<<CustomT as Module>::ExecT>, Global>
) -> Result<Vec<AppResponse, Global>, Error>
pub fn execute_multi(
&mut self,
sender: Addr,
msgs: Vec<CosmosMsg<<CustomT as Module>::ExecT>, Global>
) -> Result<Vec<AppResponse, Global>, Error>
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.
sourcepub fn wasm_sudo<T, U>(
&mut self,
contract_addr: U,
msg: &T
) -> Result<AppResponse, Error>where
T: Serialize,
U: Into<Addr>,
pub fn wasm_sudo<T, U>(
&mut self,
contract_addr: U,
msg: &T
) -> Result<AppResponse, Error>where
T: Serialize,
U: Into<Addr>,
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.
Trait Implementations§
source§impl Default for StargazeApp
impl Default for StargazeApp
source§impl Deref for StargazeApp
impl Deref for StargazeApp
§type Target = App<BankKeeper, MockApi, MemoryStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
type Target = App<BankKeeper, MockApi, MemoryStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
The resulting type after dereferencing.
source§impl DerefMut for StargazeApp
impl DerefMut for StargazeApp
source§impl Querier for StargazeApp
impl Querier for StargazeApp
source§fn raw_query(&self, bin_request: &[u8]) -> QuerierResult
fn raw_query(&self, bin_request: &[u8]) -> QuerierResult
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