From 578add05ea5ef0dd92c5f824e92b1fec960ac7c2 Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:06:55 +0000 Subject: [PATCH] test: Suppress "too high" limit via skipAmountLimit --- api/suggested-fees.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/suggested-fees.ts b/api/suggested-fees.ts index ceb724057..b79fcd1fc 100644 --- a/api/suggested-fees.ts +++ b/api/suggested-fees.ts @@ -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, @@ -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`,