From e5e8011de70422eb68fd099afb03bca31ac8bdfa Mon Sep 17 00:00:00 2001 From: Sameer Date: Mon, 19 Feb 2024 15:47:57 +0530 Subject: [PATCH] :bug: Fix balance validation logic (#2023) --- .../dataService/business/transactionsEstimateFees.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/services/blockchain-indexer/shared/dataService/business/transactionsEstimateFees.js b/services/blockchain-indexer/shared/dataService/business/transactionsEstimateFees.js index 6239642645..60e4620f67 100644 --- a/services/blockchain-indexer/shared/dataService/business/transactionsEstimateFees.js +++ b/services/blockchain-indexer/shared/dataService/business/transactionsEstimateFees.js @@ -316,17 +316,11 @@ const validateTransactionParams = async transaction => { if (transaction.params.tokenID) { const senderAddress = getLisk32AddressFromPublicKey(transaction.senderPublicKey); - const { - data: { extraCommandFees }, - } = await getTokenConstants(); const { data: [balanceInfo], } = await getTokenBalances({ address: senderAddress, tokenID: transaction.params.tokenID }); - if ( - BigInt(balanceInfo.availableBalance) < - BigInt(transaction.params.amount) + BigInt(extraCommandFees.userAccountInitializationFee) - ) { + if (BigInt(balanceInfo.availableBalance) < BigInt(transaction.params.amount)) { throw new ValidationException( `${senderAddress} has insufficient balance for ${transaction.params.tokenID} to send the transaction.`, );