Skip to content

Commit

Permalink
Lint Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerAnsh committed May 30, 2024
1 parent 1904d16 commit e814d7a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contracts/hub/vlp/src/contract.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 1 addition & 1 deletion contracts/liquidity/factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion contracts/liquidity/factory/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
Expand Down
2 changes: 1 addition & 1 deletion contracts/liquidity/pool/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
6 changes: 3 additions & 3 deletions contracts/liquidity/pool/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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()),
},
)?;
Expand Down Expand Up @@ -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()),
},
)?;
Expand Down
13 changes: 6 additions & 7 deletions packages/euclid/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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 },
Expand Down Expand Up @@ -66,17 +65,17 @@ 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 {},

#[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 {},
Expand Down

0 comments on commit e814d7a

Please sign in to comment.