Struct sg_multi_test::StargazeApp
source · [−]pub struct StargazeApp(_);Implementations
sourceimpl 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) -> T where
F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT>, &dyn Api, &mut dyn Storage) -> T,
pub fn read_module<F, T>(&self, query_fn: F) -> T where
F: FnOnce(&Router<BankT, CustomT, WasmT, StakingT, DistrT>, &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
sourceimpl Default for StargazeApp
impl Default for StargazeApp
sourceimpl Deref for StargazeApp
impl Deref for StargazeApp
type Target = App<BankKeeper, MockApi, MemoryStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>, FailingModule<StakingMsg, StakingQuery, StakingSudo>, FailingModule<DistributionMsg, Empty, Empty>>
type Target = App<BankKeeper, MockApi, MemoryStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>, FailingModule<StakingMsg, StakingQuery, StakingSudo>, FailingModule<DistributionMsg, Empty, Empty>>
The resulting type after dereferencing.
sourceimpl DerefMut for StargazeApp
impl DerefMut for StargazeApp
sourceimpl Querier for StargazeApp
impl Querier for StargazeApp
sourcefn 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 Read more
Auto Trait Implementations
impl !RefUnwindSafe for StargazeApp
impl !Send for StargazeApp
impl !Sync for StargazeApp
impl Unpin for StargazeApp
impl !UnwindSafe for StargazeApp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more