StargazeApp

Struct StargazeApp 

Source
pub struct StargazeApp(/* private fields */);

Implementations§

Source§

impl StargazeApp

Source

pub fn new() -> Self

Methods from Deref<Target = App<BankKeeper, MockApi, MockStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>>>§

Source

pub fn init_modules<F, T>(&mut self, init_fn: F) -> T
where F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &mut dyn Storage) -> T,

Source

pub fn read_module<F, T>(&self, query_fn: F) -> T
where F: FnOnce(&Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &dyn Storage) -> T,

Source

pub fn set_block(&mut self, block: BlockInfo)

Source

pub fn update_block<F>(&mut self, action: F)
where F: Fn(&mut BlockInfo),

Source

pub fn block_info(&self) -> BlockInfo

Returns a copy of the current block_info

Source

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, …

Source

pub fn execute_multi( &mut self, sender: Addr, msgs: Vec<CosmosMsg<<CustomT as Module>::ExecT>>, ) -> Result<Vec<AppResponse>, 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.

Source

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.

Source

pub fn sudo(&mut self, msg: SudoMsg) -> Result<AppResponse, Error>

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§

Source§

impl Default for StargazeApp

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for StargazeApp

Source§

type Target = App<BankKeeper, MockApi, MemoryStorage, StargazeModule, WasmKeeper<StargazeMsgWrapper, Empty>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for StargazeApp

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Querier for StargazeApp

Source§

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.