No internet connection
  1. Home
  2. General

Querier in Cw20Contract in helpers.rs

By Diarmid Campbell @dishmop
    2022-04-29 13:42:58.717Z

    Help please.

    I am trying to use the Cw20Contract to Query things about a CW20 contract. All the querying functions take a Querier argument. But I don't know where to get the querier object from.

    If I try and so this (e.g.):

    let _test = cw20.is_mintable(&deps.querier);
    

    I get this error:

    error[E0277]: the trait bound `QuerierWrapper<'_>: Querier` is not satisfied
       --> src/contract.rs:132:38
        |
    132 |         let _test = cw20.is_mintable(&deps.querier);
        |                          ----------- ^^^^^^^^^^^^^ the trait `Querier` is not implemented for `QuerierWrapper<'_>`
        |                          |
        |                          required by a bound introduced by this call
        |
        = help: the trait `Querier` is implemented for `MockQuerier<C>`
    note: required by a bound in `Cw20Contract::is_mintable`
       --> /Users/diarmidcampbell/.cargo/registry/src/github.com-1ecc6299db9ec823/cw20-0.13.1/src/helpers.rs:118:27
        |
    118 |     pub fn is_mintable<Q: Querier, CQ: CustomQuery>(&self, querier: &Q) -> bool {
        |                           ^^^^^^^ required by this bound in `Cw20Contract::is_mintable`
    
    • 0 replies