Trait secret_toolkit_utils::calls::Query
source · [−]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
const BLOCK_SIZE: usize
const BLOCK_SIZE: usize
pad the message to blocks of this size
Provided Methods
Returns StdResult
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 contractcallback_code_hash
- String holding the code hash of the contract to be queriedcontract_addr
- address of the contract being queried