pub struct QuerierWrapper<'a, C: CustomQuery = Empty> { /* private fields */ }

Implementations§

source§

impl<'a, C: CustomQuery> QuerierWrapper<'a, C>

source

pub fn new(querier: &'a dyn Querier) -> Self

source

pub fn query<U: DeserializeOwned>( &self, request: &QueryRequest<C> ) -> StdResult<U>

Makes the query and parses the response.

Any error (System Error, Error or called contract, or Parse Error) are flattened into one level. Only use this if you don’t need to check the SystemError eg. If you don’t differentiate between contract missing and contract returned error

source

pub fn query_supply(&self, denom: impl Into<String>) -> StdResult<Coin>

source

pub fn query_balance( &self, address: impl Into<String>, denom: impl Into<String> ) -> StdResult<Coin>

source

pub fn query_all_balances( &self, address: impl Into<String> ) -> StdResult<Vec<Coin>>

source

pub fn query_wasm_smart<T: DeserializeOwned>( &self, contract_addr: impl Into<String>, msg: &impl Serialize ) -> StdResult<T>

source

pub fn query_wasm_raw( &self, contract_addr: impl Into<String>, key: impl Into<Binary> ) -> StdResult<Option<Vec<u8>>>

source

pub fn query_wasm_contract_info( &self, contract_addr: impl Into<String> ) -> StdResult<ContractInfoResponse>

Given a contract address, query information about that contract.

source

pub fn query_wasm_code_info(&self, code_id: u64) -> StdResult<CodeInfoResponse>

Given a code ID, query information about that code.

source

pub fn query_all_validators(&self) -> StdResult<Vec<Validator>>

source

pub fn query_validator( &self, address: impl Into<String> ) -> StdResult<Option<Validator>>

source

pub fn query_bonded_denom(&self) -> StdResult<String>

source

pub fn query_all_delegations( &self, delegator: impl Into<String> ) -> StdResult<Vec<Delegation>>

source

pub fn query_delegation( &self, delegator: impl Into<String>, validator: impl Into<String> ) -> StdResult<Option<FullDelegation>>

Trait Implementations§

source§

impl<'a, C: Clone + CustomQuery> Clone for QuerierWrapper<'a, C>

source§

fn clone(&self) -> QuerierWrapper<'a, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, C: CustomQuery> Deref for QuerierWrapper<'a, C>

This allows us to use self.raw_query to access the querier. It also allows external callers to access the querier easily.

§

type Target = dyn Querier + 'a

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'a, C: CustomQuery> Copy for QuerierWrapper<'a, C>

Auto Trait Implementations§

§

impl<'a, C = Empty> !RefUnwindSafe for QuerierWrapper<'a, C>

§

impl<'a, C = Empty> !Send for QuerierWrapper<'a, C>

§

impl<'a, C = Empty> !Sync for QuerierWrapper<'a, C>

§

impl<'a, C> Unpin for QuerierWrapper<'a, C>where C: Unpin,

§

impl<'a, C = Empty> !UnwindSafe for QuerierWrapper<'a, C>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.