Skip to content

Commit

Permalink
fix linter (#640)
Browse files Browse the repository at this point in the history
* fix linter

* fix linter

* fix format
  • Loading branch information
jhernandezb authored Jan 25, 2024
1 parent 2ac1ae1 commit 1105e14
Show file tree
Hide file tree
Showing 32 changed files with 147 additions and 972 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions contracts/minters/vending-minter-merkle-wl/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"properties": {
"mint": {
"type": "object",
"properties": {
"proof_hashes": {
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
Expand Down
17 changes: 10 additions & 7 deletions contracts/minters/vending-minter-merkle-wl/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ use sg_std::{StargazeMsgWrapper, GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sg_whitelist::msg::{
ConfigResponse as WhitelistConfigResponse, HasMemberResponse, QueryMsg as WhitelistQueryMsg,
};
use whitelist_mtree::msg::QueryMsg as WhitelistMtreeQueryMsg;
use sha2::{Digest, Sha256};
use shuffle::{fy::FisherYates, shuffler::Shuffler};
use std::convert::TryInto;
use url::Url;
use vending_factory::msg::{ParamsResponse, VendingMinterCreateMsg};
use vending_factory::state::VendingMinterParams;
use whitelist_mtree::msg::QueryMsg as WhitelistMtreeQueryMsg;

pub type Response = cosmwasm_std::Response<StargazeMsgWrapper>;
pub type SubMsg = cosmwasm_std::SubMsg<StargazeMsgWrapper>;
Expand Down Expand Up @@ -489,7 +489,9 @@ pub fn execute_mint_sender(

// If there is no active whitelist right now, check public mint
// Check if after start_time
if is_public_mint(deps.as_ref(), &info, proof_hashes)? && (env.block.time < config.extension.start_time) {
if is_public_mint(deps.as_ref(), &info, proof_hashes)?
&& (env.block.time < config.extension.start_time)
{
return Err(ContractError::BeforeMintStartTime {});
}

Expand All @@ -504,7 +506,11 @@ pub fn execute_mint_sender(

// Check if a whitelist exists and not ended
// Sender has to be whitelisted to mint
fn is_public_mint(deps: Deps, info: &MessageInfo, proof_hashes: Option<Vec<String>>) -> Result<bool, ContractError> {
fn is_public_mint(
deps: Deps,
info: &MessageInfo,
proof_hashes: Option<Vec<String>>,
) -> Result<bool, ContractError> {
let config = CONFIG.load(deps.storage)?;

// If there is no whitelist, there's only a public mint
Expand Down Expand Up @@ -554,13 +560,10 @@ fn is_public_mint(deps: Deps, info: &MessageInfo, proof_hashes: Option<Vec<Strin
Ok(false)
}


fn is_merkle_tree_wl(wl_config_res: &WhitelistConfigResponse) -> bool {
wl_config_res.member_limit == 0 &&
wl_config_res.num_members == 0
wl_config_res.member_limit == 0 && wl_config_res.num_members == 0
}


pub fn execute_mint_to(
deps: DepsMut,
env: Env,
Expand Down
2 changes: 1 addition & 1 deletion contracts/minters/vending-minter-merkle-wl/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct InstantiateMsg {
#[cw_serde]
pub enum ExecuteMsg {
Mint {
proof_hashes: Option<Vec<String>>
proof_hashes: Option<Vec<String>>,
},
SetWhitelist {
whitelist: String,
Expand Down
81 changes: 0 additions & 81 deletions contracts/whitelists/whitelist-merkletree/schema/raw/execute.json

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1105e14

Please sign in to comment.