pub trait Query: Serialize {
    const BLOCK_SIZE: usize;

    fn query<Q: Querier, T: DeserializeOwned>(
        &self,
        querier: &Q,
        callback_code_hash: String,
        contract_addr: HumanAddr
    ) -> StdResult<T> { ... } }
Expand description

A trait marking types that define the query message(s) of a contract

This trait requires specifying a padding block size and provides a method to query a contract

Required Associated Constants

pad the message to blocks of this size

Provided Methods

Returns StdResult, where T is the type defining the query response

Tries to query a contract and deserialize the query response. The BLOCK_SIZE specified in the implementation is used when padding the message

Arguments
  • querier - a reference to the Querier dependency of the querying contract
  • callback_code_hash - String holding the code hash of the contract to be queried
  • contract_addr - address of the contract being queried

Implementors