Skip to content

Commit

Permalink
fix: can't use Boolean for BN
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Feb 14, 2025
1 parent 166ce02 commit 52b0c59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pools/mixins/depositBalancedAmountsMixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function _depositBalancedAmounts(poolBalances: string[], walletBalances: string[
))
));
const firstCoinBalanceForEachScenarioBN = balancedAmountsForEachScenarioBN.map(([a]) => a);
const min = BigNumber.min(...firstCoinBalanceForEachScenarioBN.filter(Boolean)); // ignore any coins not present in the wallet
const scenarioWithLowestBalancesBN = firstCoinBalanceForEachScenarioBN.map(String).indexOf(min.toString());

return balancedAmountsForEachScenarioBN[scenarioWithLowestBalancesBN].map(
(a, i) => walletBalancesBN[i].isZero() ? "0" : a.toFixed(decimals[i])
)
// get the scenario with the lowest balances, ignoring scenarios where the wallet balance is zero
const min = BigNumber.min(...firstCoinBalanceForEachScenarioBN.filter(b => !b.isZero()));

Check failure on line 21 in src/pools/mixins/depositBalancedAmountsMixins.ts

View workflow job for this annotation

GitHub Actions / test

Expected parentheses around arrow function argument
const scenarioWithLowestBalancesBN = firstCoinBalanceForEachScenarioBN.map(String).indexOf(min.toString());
const bestScenario = balancedAmountsForEachScenarioBN[scenarioWithLowestBalancesBN];
return bestScenario.map((a, i) => walletBalancesBN[i].isZero() ? "0" : a.toFixed(decimals[i]))
}

// @ts-ignore
Expand Down

0 comments on commit 52b0c59

Please sign in to comment.