Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-c-child committed Mar 23, 2024
1 parent 33fec3c commit 4a33329
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion contracts/whitelist-updatable-flatrate/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ pub fn execute_purge(deps: DepsMut, info: MessageInfo) -> Result<Response, Contr
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::Config {} => to_binary(&query_config(deps)?),
QueryMsg::IncludesAddress { address } => to_binary(&query_includes_address(deps, address)?),
QueryMsg::IncludesAddress { address, updatable_whitelist: Addr } => to_binary(&query_includes_address(deps, address)?),
QueryMsg::IncludesAddressFlatrate { address } => to_binary(&query_includes_address(deps, address)?),
QueryMsg::MintCount { address } => to_binary(&query_mint_count(deps, address)?),
QueryMsg::Admins {} => to_binary(&query_admins(deps)?),
QueryMsg::AddressCount {} => to_binary(&query_address_count(deps)?),
Expand Down
4 changes: 2 additions & 2 deletions contracts/whitelist-updatable-flatrate/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ impl WhitelistUpdatableFlatrateContract {
})
}

pub fn includes(&self, querier: &QuerierWrapper, address: String) -> StdResult<bool> {
pub fn includes(&self, querier: &QuerierWrapper, address: String, ) -> StdResult<bool> {
let includes: bool = querier.query(&QueryRequest::Wasm(WasmQuery::Smart {
contract_addr: self.addr().into(),
msg: to_binary(&QueryMsg::IncludesAddress { address })?,
msg: to_binary(&QueryMsg::IncludesAddress { address, updatable_whitelist })?,
}))?;
Ok(includes)
}
Expand Down
5 changes: 4 additions & 1 deletion contracts/whitelist-updatable-flatrate/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::Addr;

use crate::state::Config;

Expand Down Expand Up @@ -37,7 +38,9 @@ pub enum QueryMsg {
#[returns(Config)]
Config {},
#[returns(bool)]
IncludesAddress { address: String },
IncludesAddress { address: String, updatable_whitelist: Addr },
#[returns(bool)]
IncludesAddressFlatrate { address: String },
#[returns(u64)]
MintCount { address: String },
/// Avoid processing addresses that will fail. Includes address and under per address limit
Expand Down

0 comments on commit 4a33329

Please sign in to comment.