From 153e9227e266e6e7943145d2b3374db41810ba59 Mon Sep 17 00:00:00 2001 From: Kirill Litvinov Date: Thu, 14 Dec 2023 21:22:31 +0300 Subject: [PATCH] test --- src/Unit/Exchange/generateSwapCalldata.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Unit/Exchange/generateSwapCalldata.ts b/src/Unit/Exchange/generateSwapCalldata.ts index 9d236ca..e5cc5be 100644 --- a/src/Unit/Exchange/generateSwapCalldata.ts +++ b/src/Unit/Exchange/generateSwapCalldata.ts @@ -422,7 +422,7 @@ async function shouldUseExchangeBalance( amount: bigint, provider: JsonRpcProvider ) { - const { walletBalance, exchangeBalance } = await getTotalBalance( + const { exchangeBalance } = await getTotalBalance( srcToken, initiatorAddress, exchangeContractAddress, @@ -435,13 +435,13 @@ async function shouldUseExchangeBalance( provider ); - if (walletBalance + exchangeBalance < amount) { - throw new Error( - `Not enough balance to make swap, totalBalance - ${ - walletBalance + exchangeBalance - } swapAmount - ${amount}` - ); - } + // if (walletBalance + exchangeBalance < amount) { + // throw new Error( + // `Not enough balance to make swap, totalBalance - ${ + // walletBalance + exchangeBalance + // } swapAmount - ${amount}` + // ); + // } let useExchangeBalance = true; let additionalTransferAmount = 0n;