Struct clone_cw_multi_test::wasm_emulation::query::mock_querier::MockQuerier
source · pub struct MockQuerier<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> { /* private fields */ }Expand description
MockQuerier holds an immutable table of bank balances and configurable handlers for Wasm queries and custom queries.
Implementations§
source§impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> MockQuerier<ExecC, QueryC>
impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> MockQuerier<ExecC, QueryC>
pub fn new(fork_state: ForkState<ExecC, QueryC>) -> Self
pub fn update_balance( &mut self, addr: impl Into<String>, balance: Vec<Coin>, ) -> Option<Vec<Coin>>
pub fn update_staking( &mut self, denom: &str, validators: &[Validator], delegations: &[FullDelegation], )
pub fn with_custom_handler<CH>(self, handler: CH) -> Self
source§impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> MockQuerier<ExecC, QueryC>
impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> MockQuerier<ExecC, QueryC>
pub fn handle_query(&self, request: &QueryRequest<QueryC>) -> QueryResultWithGas
Trait Implementations§
source§impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> Querier for MockQuerier<ExecC, QueryC>
impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> Querier for MockQuerier<ExecC, QueryC>
source§fn query_raw(
&self,
bin_request: &[u8],
_gas_limit: u64,
) -> BackendResult<SystemResult<ContractResult<Binary>>>
fn query_raw( &self, bin_request: &[u8], _gas_limit: u64, ) -> BackendResult<SystemResult<ContractResult<Binary>>>
This 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. Read more
source§impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> Querier for MockQuerier<ExecC, QueryC>
impl<ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static> Querier for MockQuerier<ExecC, QueryC>
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<ExecC, QueryC> Freeze for MockQuerier<ExecC, QueryC>
impl<ExecC, QueryC> !RefUnwindSafe for MockQuerier<ExecC, QueryC>
impl<ExecC, QueryC> !Send for MockQuerier<ExecC, QueryC>
impl<ExecC, QueryC> !Sync for MockQuerier<ExecC, QueryC>
impl<ExecC, QueryC> Unpin for MockQuerier<ExecC, QueryC>
impl<ExecC, QueryC> !UnwindSafe for MockQuerier<ExecC, QueryC>
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Requestsource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.