diff --git a/contracts/modules/mint/src/contract.rs b/contracts/modules/mint/src/contract.rs index 93880a9..6928063 100644 --- a/contracts/modules/mint/src/contract.rs +++ b/contracts/modules/mint/src/contract.rs @@ -266,6 +266,8 @@ pub fn execute_create_collection( COLLECTION_INFO.save(deps.storage, collection_id, &collection_info)?; + MINT_LOCKS.save(deps.storage, collection_id, &false)?; + let cw20_address = match fund_info.cw20_address { Some(addr) => Some(deps.api.addr_validate(&addr)?), None => None, @@ -414,8 +416,8 @@ fn execute_mint( collection_id: u32, metadata_id: Option, ) -> Result { - let mint_lock = MINT_LOCKS.may_load(deps.storage, collection_id)?; - if let Some(_mint_lock) = mint_lock { + let mint_lock = MINT_LOCKS.load(deps.storage, collection_id)?; + if mint_lock { return Err(ContractError::LockedMint {}); } @@ -713,8 +715,8 @@ fn execute_receive( collection_id, metadata_id, } => { - let mint_lock = MINT_LOCKS.may_load(deps.storage, collection_id)?; - if let Some(_mint_lock) = mint_lock { + let mint_lock = MINT_LOCKS.load(deps.storage, collection_id)?; + if mint_lock { return Err(ContractError::LockedMint {}); } @@ -1002,11 +1004,8 @@ fn query_creators(deps: Deps) -> StdResult>> { } fn query_mint_lock(deps: Deps, collection_id: u32) -> StdResult> { - let mint_lock = MINT_LOCKS.may_load(deps.storage, collection_id)?; - Ok(ResponseWrapper::new( - "mint_lock", - mint_lock.unwrap_or(false), - )) + let mint_lock = MINT_LOCKS.load(deps.storage, collection_id)?; + Ok(ResponseWrapper::new("mint_lock", mint_lock)) } #[cfg_attr(not(feature = "library"), entry_point)] diff --git a/contracts/modules/mint/tests/integration.rs b/contracts/modules/mint/tests/integration.rs index dc1a82e..76fb37d 100644 --- a/contracts/modules/mint/tests/integration.rs +++ b/contracts/modules/mint/tests/integration.rs @@ -256,11 +256,6 @@ mod actions { .query_wasm_smart(minter_addr.clone(), &msg) .unwrap(); assert_eq!(response.data, true); - - let msg = QueryMsg::MintLock { collection_id: 2 }; - let response: ResponseWrapper = - app.wrap().query_wasm_smart(minter_addr, &msg).unwrap(); - assert_eq!(response.data, false); } }