Skip to content

Commit

Permalink
chore(smart-contracts): please the lord clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
nseguias committed May 7, 2024
1 parent c14fb19 commit 0176c1a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contracts/liquidity_hub/pool-manager/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,15 +674,14 @@ pub fn compute_d(amp_factor: &u64, deposits: &Vec<Coin>) -> Option<Uint256> {
// sum(x_i), a.k.a S
let sum_x = deposits
.iter()
.fold(Uint128::zero(), |acc, x| acc.checked_add(x.amount).unwrap())
.clone();
.fold(Uint128::zero(), |acc, x| acc.checked_add(x.amount).unwrap());

if sum_x == Uint128::zero() {
Some(Uint256::zero())

Check warning on line 680 in contracts/liquidity_hub/pool-manager/src/helpers.rs

View check run for this annotation

Codecov / codecov/patch

contracts/liquidity_hub/pool-manager/src/helpers.rs#L680

Added line #L680 was not covered by tests
} else {
// do as below but for a generic number of assets
let amount_times_coins: Vec<Uint128> = deposits
.into_iter()
.iter()
.map(|coin| coin.amount.checked_mul(n_coins).unwrap())
.collect();

Expand Down Expand Up @@ -750,7 +749,7 @@ fn compute_next_d(
pub fn compute_mint_amount_for_deposit(

Check warning on line 749 in contracts/liquidity_hub/pool-manager/src/helpers.rs

View check run for this annotation

Codecov / codecov/patch

contracts/liquidity_hub/pool-manager/src/helpers.rs#L749

Added line #L749 was not covered by tests
amp_factor: &u64,
deposits: &Vec<Coin>,
pool_assets: &Vec<Coin>,
pool_assets: &[Coin],
pool_token_supply: Uint128,
) -> Option<Uint128> {
// Initial invariant
Expand Down

0 comments on commit 0176c1a

Please sign in to comment.