Trait secret_toolkit_utils::calls::Query
source · pub trait Query: Serialize {
const BLOCK_SIZE: usize;
fn query<C: CustomQuery, T: DeserializeOwned>(
&self,
querier: QuerierWrapper<'_, C>,
code_hash: String,
contract_addr: String
) -> 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§
sourceconst BLOCK_SIZE: usize
const BLOCK_SIZE: usize
pad the message to blocks of this size
Provided Methods§
sourcefn query<C: CustomQuery, T: DeserializeOwned>(
&self,
querier: QuerierWrapper<'_, C>,
code_hash: String,
contract_addr: String
) -> StdResult<T>
fn query<C: CustomQuery, T: DeserializeOwned>(
&self,
querier: QuerierWrapper<'_, C>,
code_hash: String,
contract_addr: String
) -> StdResult<T>
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