Skip to content

Commit

Permalink
Adapt unit tests to support ContractInfo query
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Nov 30, 2021
1 parent ae227ef commit bbbd3ce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/tgrade-trusted-circle/src/tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::marker::PhantomData;

use cosmwasm_std::testing::{MockApi, MockStorage};
use cosmwasm_std::{
Addr, Binary, ContractResult, Deps, Empty, QuerierResult, QueryRequest, StdError, SubMsg,
SystemError, SystemResult, WasmQuery,
to_binary, Addr, Binary, ContractResult, Deps, Empty, QuerierResult, QueryRequest, StdError,
SubMsg, SystemError, SystemResult, WasmQuery,
};
use cw_storage_plus::Item;

Expand Down Expand Up @@ -45,6 +45,10 @@ impl TokenQuerier {
kind: "WasmQuery::Smart".to_string(),
})
}
QueryRequest::Wasm(WasmQuery::ContractInfo { contract_addr }) => {
// FIXME: Implement a proper `ContractInfo` mock query
self.query_wasm(contract_addr, to_binary(b"contract_info").unwrap())
}
_ => SystemResult::Err(SystemError::UnsupportedRequest {
kind: "not wasm".to_string(),
}),
Expand Down

0 comments on commit bbbd3ce

Please sign in to comment.