@@ -464,12 +464,12 @@ pub type MockQuerierCustomHandlerResult = SystemResult<ContractResult<Binary>>;
464464pub struct MockQuerier < C : DeserializeOwned = Empty > {
465465 pub bank : BankQuerier ,
466466 #[ cfg( feature = "staking" ) ]
467- staking : StakingQuerier ,
467+ pub staking : StakingQuerier ,
468468 #[ cfg( feature = "cosmwasm_1_3" ) ]
469469 pub distribution : DistributionQuerier ,
470470 wasm : WasmQuerier ,
471471 #[ cfg( feature = "stargate" ) ]
472- ibc : IbcQuerier ,
472+ pub ibc : IbcQuerier ,
473473 /// A handler to handle custom queries. This is set to a dummy handler that
474474 /// always errors by default. Update it via `with_custom_handler`.
475475 ///
@@ -497,21 +497,6 @@ impl<C: DeserializeOwned> MockQuerier<C> {
497497 }
498498 }
499499
500- #[ cfg( feature = "staking" ) ]
501- pub fn update_staking (
502- & mut self ,
503- denom : & str ,
504- validators : & [ crate :: query:: Validator ] ,
505- delegations : & [ crate :: query:: FullDelegation ] ,
506- ) {
507- self . staking = StakingQuerier :: new ( denom, validators, delegations) ;
508- }
509-
510- #[ cfg( feature = "stargate" ) ]
511- pub fn update_ibc ( & mut self , port_id : & str , channels : & [ IbcChannel ] ) {
512- self . ibc = IbcQuerier :: new ( port_id, channels) ;
513- }
514-
515500 pub fn update_wasm < WH : ' static > ( & mut self , handler : WH )
516501 where
517502 WH : Fn ( & WasmQuery ) -> QuerierResult ,
@@ -800,6 +785,12 @@ impl IbcQuerier {
800785 }
801786 }
802787
788+ /// Update the querier's configuration
789+ pub fn update ( & mut self , port_id : impl Into < String > , channels : & [ IbcChannel ] ) {
790+ self . port_id = port_id. into ( ) ;
791+ self . channels = channels. to_vec ( ) ;
792+ }
793+
803794 pub fn query ( & self , request : & IbcQuery ) -> QuerierResult {
804795 let contract_result: ContractResult < Binary > = match request {
805796 IbcQuery :: Channel {
@@ -863,6 +854,18 @@ impl StakingQuerier {
863854 }
864855 }
865856
857+ /// Update the querier's configuration
858+ pub fn update (
859+ & mut self ,
860+ denom : impl Into < String > ,
861+ validators : & [ Validator ] ,
862+ delegations : & [ FullDelegation ] ,
863+ ) {
864+ self . denom = denom. into ( ) ;
865+ self . validators = validators. to_vec ( ) ;
866+ self . delegations = delegations. to_vec ( ) ;
867+ }
868+
866869 pub fn query ( & self , request : & StakingQuery ) -> QuerierResult {
867870 let contract_result: ContractResult < Binary > = match request {
868871 StakingQuery :: BondedDenom { } => {
0 commit comments