diff --git a/contracts/hub/vlp/src/contract.rs b/contracts/hub/vlp/src/contract.rs index 86f236a8..f383bcfa 100644 --- a/contracts/hub/vlp/src/contract.rs +++ b/contracts/hub/vlp/src/contract.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{ensure, Binary, Deps, DepsMut, Env, MessageInfo, Response, Uint128}; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, Uint128}; use cw2::set_contract_version; use crate::state::{State, STATE}; diff --git a/contracts/liquidity/factory/src/contract.rs b/contracts/liquidity/factory/src/contract.rs index 0d418bdd..25015ae6 100644 --- a/contracts/liquidity/factory/src/contract.rs +++ b/contracts/liquidity/factory/src/contract.rs @@ -26,7 +26,7 @@ pub fn instantiate( router_contract: msg.router_contract.clone(), chain_id: env.block.chain_id, admin: info.sender.clone().to_string(), - pool_code_id: msg.pool_code_id.clone(), + pool_code_id: msg.pool_code_id, }; set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; diff --git a/contracts/liquidity/factory/src/state.rs b/contracts/liquidity/factory/src/state.rs index c2b97d53..5ba00cde 100644 --- a/contracts/liquidity/factory/src/state.rs +++ b/contracts/liquidity/factory/src/state.rs @@ -54,7 +54,7 @@ pub fn generate_pool_req( }; // If a pool request already exist, throw error, else create a new request POOL_REQUESTS.update(deps.storage, pool_rq_id, |existing| match existing { - Some(req) => Err(ContractError::PoolRequestAlreadyExists { req }), + Some(_req) => Err(ContractError::PoolRequestAlreadyExists {}), None => Ok(pool_request.clone()), })?; POOL_REQUEST_COUNT.save(deps.storage, sender.to_string(), &count.wrapping_add(1))?; diff --git a/contracts/liquidity/pool/src/execute.rs b/contracts/liquidity/pool/src/execute.rs index ded37226..105b5d68 100644 --- a/contracts/liquidity/pool/src/execute.rs +++ b/contracts/liquidity/pool/src/execute.rs @@ -181,7 +181,7 @@ pub fn execute_reject_swap( Ok(Response::new() .add_attribute("method", "process_failed_swap") .add_attribute("refund_to", "sender") - .add_attribute("refund_amount", swap_info.asset_amount.clone()) + .add_attribute("refund_amount", swap_info.asset_amount) .add_attribute("error", error.unwrap_or_default()) .add_message(msg)) } diff --git a/contracts/liquidity/pool/src/state.rs b/contracts/liquidity/pool/src/state.rs index 5fbb169d..a788cec5 100644 --- a/contracts/liquidity/pool/src/state.rs +++ b/contracts/liquidity/pool/src/state.rs @@ -3,7 +3,7 @@ use euclid::{ error::ContractError, liquidity::{self, LiquidityTxInfo}, swap::{self, SwapInfo}, - token::{Pair, PairInfo, TokenInfo}, + token::{PairInfo, TokenInfo}, }; use cosmwasm_std::{DepsMut, IbcTimeout, Uint128}; @@ -61,7 +61,7 @@ pub fn generate_swap_req( deps.storage, (sender.clone(), count), |existing| match existing { - Some(req) => Err(ContractError::SwapAlreadyExist { req }), + Some(_req) => Err(ContractError::SwapAlreadyExist {}), None => Ok(request.clone()), }, )?; @@ -97,7 +97,7 @@ pub fn generate_liquidity_req( deps.storage, (sender.clone(), count), |existing| match existing { - Some(req) => Err(ContractError::LiquidityTxAlreadyExist { req }), + Some(_req) => Err(ContractError::LiquidityTxAlreadyExist {}), None => Ok(request.clone()), }, )?; diff --git a/packages/euclid/src/error.rs b/packages/euclid/src/error.rs index 8f69dd38..cdfe3578 100644 --- a/packages/euclid/src/error.rs +++ b/packages/euclid/src/error.rs @@ -4,7 +4,6 @@ use cosmwasm_std::{DivideByZeroError, OverflowError, StdError, Uint128}; use thiserror::Error; -use crate::{liquidity::LiquidityTxInfo, pool::PoolRequest, swap::SwapInfo}; #[derive(Error, Debug)] pub enum Never {} #[derive(Error, Debug)] @@ -27,8 +26,8 @@ pub enum ContractError { #[error("Unauthorized")] Unauthorized {}, - #[error("Pool request {req:?} already exist")] - PoolRequestAlreadyExists { req: PoolRequest }, + #[error("Pool request already exist")] + PoolRequestAlreadyExists {}, #[error("Pool request {req:?} already exist")] PoolRequestDoesNotExists { req: String }, @@ -66,8 +65,8 @@ pub enum ContractError { #[error("The swap does not exist in state for the sender")] SwapDoesNotExist {}, - #[error("The swap - {req:?} already exist in state for the sender")] - SwapAlreadyExist { req: SwapInfo }, + #[error("Swap already exist in state for the sender")] + SwapAlreadyExist {}, #[error("The deposit amount is insufficient to add the liquidity")] InsufficientDeposit {}, @@ -75,8 +74,8 @@ pub enum ContractError { #[error("The CHAIN ID is not valid")] InvalidChainId {}, - #[error("The liquity tx - {req:?} already exist in state for the sender")] - LiquidityTxAlreadyExist { req: LiquidityTxInfo }, + #[error("Liquity already exist in state for the sender")] + LiquidityTxAlreadyExist {}, #[error("Slippage has been exceeded when providing liquidity.")] LiquiditySlippageExceeded {},