Struct MarsMockQuerier

Source
pub struct MarsMockQuerier { /* private fields */ }

Implementations§

Source§

impl MarsMockQuerier

Source

pub fn new(base: MockQuerier<TerraQueryWrapper>) -> Self

Source

pub fn set_contract_balances(&mut self, contract_balances: &[Coin])

Set new balances for contract address

Source

pub fn set_native_exchange_rates( &mut self, base_denom: String, exchange_rates: &[(String, Decimal)], )

Set mock querier exchange rates query results for a given denom

Source

pub fn set_native_tax( &mut self, tax_rate: Decimal, tax_caps: &[(String, Uint128)], )

Set mock querier for tax data

Source

pub fn set_cw20_balances( &mut self, cw20_address: Addr, balances: &[(Addr, Uint128)], )

Set mock querier balances results for a given cw20 token

Source

pub fn set_cw20_total_supply( &mut self, cw20_address: Addr, total_supply: Uint128, )

Set mock querier so that it returns a specific total supply on the token info query for a given cw20 token (note this will override existing token info with default values for the rest of the fields)

Source

pub fn set_cw20_symbol(&mut self, cw20_address: Addr, symbol: String)

Source

pub fn set_oracle_price(&mut self, asset_reference: Vec<u8>, price: Decimal)

Source

pub fn set_staking_xmars_per_mars(&mut self, xmars_per_mars: Decimal)

Source

pub fn set_staking_mars_per_xmars(&mut self, mars_per_xmars: Decimal)

Source

pub fn set_xmars_address(&mut self, address: Addr)

Source

pub fn set_xmars_balance_at( &mut self, address: Addr, block: u64, balance: Uint128, )

Source

pub fn set_xmars_total_supply_at(&mut self, block: u64, balance: Uint128)

Source

pub fn set_vesting_address(&mut self, address: Addr)

Source

pub fn set_vesting_voting_power_at( &mut self, address: Addr, block: u64, voting_power: Uint128, )

Source

pub fn set_vesting_total_voting_power_at( &mut self, block: u64, total_voting_power: Uint128, )

Source

pub fn set_astroport_pair(&mut self, pair_info: PairInfo)

Source

pub fn set_astroport_pair_cumulative_prices( &mut self, contract_addr: String, cumulative_prices: CumulativePricesResponse, )

Source

pub fn set_astroport_pair_simulation( &mut self, contract_addr: String, simulation: SimulationResponse, )

Source

pub fn set_incentives_address(&mut self, address: Addr)

Source

pub fn set_unclaimed_rewards( &mut self, user_address: String, unclaimed_rewards: Uint128, )

Source

pub fn handle_query( &self, request: &QueryRequest<TerraQueryWrapper>, ) -> QuerierResult

Trait Implementations§

Source§

impl Querier for MarsMockQuerier

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<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> 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.