Skip to content

Commit

Permalink
Merge pull request #679 from public-awesome/jhernandezb/undo-config-r…
Browse files Browse the repository at this point in the history
…esposne

undo config response
  • Loading branch information
jhernandezb authored Apr 3, 2024
2 parents 0a87b6b + 9f77eb3 commit 509237b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,9 @@
"required": [
"end_time",
"is_active",
"merkle_root",
"member_limit",
"mint_price",
"num_members",
"per_address_limit",
"start_time"
],
Expand All @@ -673,12 +674,19 @@
"is_active": {
"type": "boolean"
},
"merkle_root": {
"type": "string"
"member_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"mint_price": {
"$ref": "#/definitions/Coin"
},
"num_members": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"per_address_limit": {
"type": "integer",
"format": "uint32",
Expand Down
4 changes: 2 additions & 2 deletions contracts/whitelists/whitelist-merkletree/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ pub fn query_has_member(

pub fn query_config(deps: Deps, env: Env) -> StdResult<ConfigResponse> {
let config = CONFIG.load(deps.storage)?;
let merkle_root = MERKLE_ROOT.load(deps.storage)?;
Ok(ConfigResponse {
num_members: 0,
member_limit: 0,
per_address_limit: config.per_address_limit,
start_time: config.start_time,
end_time: config.end_time,
mint_price: config.mint_price,
is_active: (env.block.time >= config.start_time) && (env.block.time < config.end_time),
merkle_root,
})
}

Expand Down
3 changes: 2 additions & 1 deletion contracts/whitelists/whitelist-merkletree/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ pub struct MintPriceResponse {

#[cw_serde]
pub struct ConfigResponse {
pub num_members: u32,
pub per_address_limit: u32,
pub member_limit: u32,
pub start_time: Timestamp,
pub end_time: Timestamp,
pub mint_price: Coin,
pub is_active: bool,
pub merkle_root: String,
}

#[cw_serde]
Expand Down

0 comments on commit 509237b

Please sign in to comment.