Skip to content

Commit

Permalink
test: Suppress "too high" limit via skipAmountLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Nov 26, 2024
1 parent dcb3b15 commit 578add0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ const handler = async (
.mul(parseUnits(tokenPriceUsd.toString(), 18))
.div(parseUnits("1", inputToken.decimals));

if (amount.gt(maxDeposit)) {
const skipAmountLimitEnabled = skipAmountLimit === "true";
if (!skipAmountLimitEnabled && amount.gt(maxDeposit)) {
throw new AmountTooHighError({
message: `Amount exceeds max. deposit limit: ${ethers.utils.formatUnits(
maxDeposit,
Expand All @@ -237,7 +238,6 @@ const handler = async (

const isAmountTooLow = BigNumber.from(amountInput).lt(minDeposit);

const skipAmountLimitEnabled = skipAmountLimit === "true";
if (!skipAmountLimitEnabled && isAmountTooLow) {
throw new AmountTooLowError({
message: `Sent amount is too low relative to fees`,
Expand Down

0 comments on commit 578add0

Please sign in to comment.