pub struct MockQuerier<C = Empty>where
C: DeserializeOwned,{
pub bank: BankQuerier,
pub staking: StakingQuerier,
pub distribution: DistributionQuerier,
pub ibc: IbcQuerier,
/* private fields */
}
Expand description
MockQuerier holds an immutable table of bank balances and configurable handlers for Wasm queries and custom queries.
Fields§
§bank: BankQuerier
§staking: StakingQuerier
§distribution: DistributionQuerier
§ibc: IbcQuerier
Implementations§
Source§impl<C> MockQuerier<C>where
C: DeserializeOwned,
impl<C> MockQuerier<C>where
C: DeserializeOwned,
pub fn new(balances: &[(&str, &[Coin])]) -> MockQuerier<C>
pub fn update_wasm<WH>(&mut self, handler: WH)
pub fn with_custom_handler<CH>(self, handler: CH) -> MockQuerier<C>
Source§impl<C> MockQuerier<C>where
C: CustomQuery + DeserializeOwned,
impl<C> MockQuerier<C>where
C: CustomQuery + DeserializeOwned,
pub fn handle_query( &self, request: &QueryRequest<C>, ) -> SystemResult<ContractResult<Binary>>
Trait Implementations§
Source§impl Default for MockQuerier
impl Default for MockQuerier
Source§fn default() -> MockQuerier
fn default() -> MockQuerier
Returns the “default value” for a type. Read more
Source§impl<C> Querier for MockQuerier<C>where
C: CustomQuery + DeserializeOwned,
impl<C> Querier for MockQuerier<C>where
C: CustomQuery + DeserializeOwned,
Source§fn raw_query(&self, bin_request: &[u8]) -> SystemResult<ContractResult<Binary>>
fn raw_query(&self, bin_request: &[u8]) -> SystemResult<ContractResult<Binary>>
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§
impl<C> Freeze for MockQuerier<C>
impl<C = Empty> !RefUnwindSafe for MockQuerier<C>
impl<C = Empty> !Send for MockQuerier<C>
impl<C = Empty> !Sync for MockQuerier<C>
impl<C> Unpin for MockQuerier<C>
impl<C = Empty> !UnwindSafe for MockQuerier<C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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