Skip to content

Commit

Permalink
Add query_wasm_code_info to querier
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jan 3, 2023
1 parent c6505ec commit 08a2bf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/std/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::coin::Coin;
use crate::errors::{RecoverPubkeyError, StdError, StdResult, VerificationError};
#[cfg(feature = "iterator")]
use crate::iterator::{Order, Record};
#[cfg(feature = "cosmwasm_1_2")]
use crate::query::CodeInfoResponse;
#[cfg(feature = "cosmwasm_1_1")]
use crate::query::SupplyResponse;
use crate::query::{
Expand Down Expand Up @@ -304,6 +306,13 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> {
self.query(&request)
}

/// Given a code ID, query information about that code.
#[cfg(feature = "cosmwasm_1_2")]
pub fn query_wasm_code_info(&self, code_id: u64) -> StdResult<CodeInfoResponse> {
let request = WasmQuery::CodeInfo { code_id }.into();
self.query(&request)
}

#[cfg(feature = "staking")]
pub fn query_all_validators(&self) -> StdResult<Vec<Validator>> {
let request = StakingQuery::AllValidators {}.into();
Expand Down

0 comments on commit 08a2bf7

Please sign in to comment.