From 05f42fcb95c00f5b01306482c230b0f840a4b6e3 Mon Sep 17 00:00:00 2001 From: Humanalgorithm Date: Tue, 4 Jul 2023 16:23:53 -0400 Subject: [PATCH] cargo lint --- contracts/factories/base-factory/src/contract.rs | 3 ++- contracts/factories/vending-factory/src/contract.rs | 1 - contracts/minters/open-edition-minter/src/contract.rs | 8 ++++---- contracts/minters/vending-minter/src/contract.rs | 9 ++------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/contracts/factories/base-factory/src/contract.rs b/contracts/factories/base-factory/src/contract.rs index 069e61592..3f4054c62 100644 --- a/contracts/factories/base-factory/src/contract.rs +++ b/contracts/factories/base-factory/src/contract.rs @@ -151,6 +151,7 @@ pub fn update_params( } if let Some(min_mint_price) = param_msg.min_mint_price { + //TODO BURNTOMINT match min_mint_price.clone() { sg2::Token::Fungible(mint_price) => { ensure_eq!( @@ -159,7 +160,7 @@ pub fn update_params( ContractError::InvalidDenom {} ); } - sg2::Token::NonFungible(collection) => { + sg2::Token::NonFungible(_) => { // TODO: make sure we can query the collection // perform a query on the collection so we know its the right type } diff --git a/contracts/factories/vending-factory/src/contract.rs b/contracts/factories/vending-factory/src/contract.rs index b118f2e8d..cec0f5b43 100644 --- a/contracts/factories/vending-factory/src/contract.rs +++ b/contracts/factories/vending-factory/src/contract.rs @@ -9,7 +9,6 @@ use cw2::set_contract_version; use cw_utils::must_pay; use sg1::checked_fair_burn; use sg2::query::{AllowedCollectionCodeIdResponse, AllowedCollectionCodeIdsResponse, Sg2QueryMsg}; -use sg2::Token; use sg_std::{Response, NATIVE_DENOM}; use crate::error::ContractError; diff --git a/contracts/minters/open-edition-minter/src/contract.rs b/contracts/minters/open-edition-minter/src/contract.rs index ce3e7c4a5..dc5c81495 100644 --- a/contracts/minters/open-edition-minter/src/contract.rs +++ b/contracts/minters/open-edition-minter/src/contract.rs @@ -1,8 +1,8 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - coin, ensure, to_binary, Addr, BankMsg, Binary, Coin, Deps, DepsMut, Empty, Env, MessageInfo, - Order, Reply, ReplyOn, StdError, StdResult, Timestamp, WasmMsg, + coin, to_binary, Addr, BankMsg, Binary, Coin, Deps, DepsMut, Empty, Env, MessageInfo, Order, + Reply, ReplyOn, StdError, StdResult, Timestamp, WasmMsg, }; use cw2::set_contract_version; use cw_utils::{may_pay, maybe_addr, nonpayable, parse_reply_instantiate_data}; @@ -410,9 +410,9 @@ pub fn execute_update_mint_price( let config_mint_price = config.mint_price.clone().amount()?.u128(); // If current time is after the stored start_time, only allow lowering price - if env.block.time >= config.extension.start_time && price >= config_mint_price.clone() { + if env.block.time >= config.extension.start_time && price >= config_mint_price { return Err(ContractError::UpdatedMintPriceTooHigh { - allowed: config_mint_price.clone(), + allowed: config_mint_price, updated: price, }); } diff --git a/contracts/minters/vending-minter/src/contract.rs b/contracts/minters/vending-minter/src/contract.rs index c567c9675..7e2f5a0f4 100644 --- a/contracts/minters/vending-minter/src/contract.rs +++ b/contracts/minters/vending-minter/src/contract.rs @@ -290,7 +290,7 @@ pub fn execute_update_discount_price( .denom() .map_err(|_| ContractError::IncorrectFungibility {})?; - config.extension.discount_price = Some(coin(price, config_denom.clone())); + config.extension.discount_price = Some(coin(price, config_denom)); CONFIG.save(deps.storage, &config)?; Ok(Response::new() @@ -1055,12 +1055,7 @@ pub fn mint_price(deps: Deps, is_admin: bool) -> Result { if is_admin { return Ok(coin( - factory_params - .extension - .airdrop_mint_price - .clone() - .amount - .u128(), + factory_params.extension.airdrop_mint_price.amount.u128(), config_denom, )); }