From 9032ed2fe596cb829c51de0a9672391ab6442174 Mon Sep 17 00:00:00 2001 From: Sameer Kumar Subudhi Date: Thu, 8 Feb 2024 22:46:45 +0530 Subject: [PATCH] :ok_hand: Apply review recommendations --- services/export/shared/helpers/transaction.js | 3 --- services/export/shared/transactionsExport.js | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/services/export/shared/helpers/transaction.js b/services/export/shared/helpers/transaction.js index ea0284438..bd48b6988 100644 --- a/services/export/shared/helpers/transaction.js +++ b/services/export/shared/helpers/transaction.js @@ -35,16 +35,13 @@ const normalizeTransactionAmount = (address, tx, currentChainID) => { return (sign * amount).toString(); } - const isReclaim = tx.moduleCommand === `${MODULE.LEGACY}:${COMMAND.RECLAIM_LSK}`; const isTokenTransfer = tx.moduleCommand === `${MODULE.TOKEN}:${COMMAND.TRANSFER}`; - const isSender = address === tx.sender.address; const isRecipient = isTokenTransfer && address === tx.params.recipientAddress; const isSelfTransfer = isTokenTransfer && tx.sender.address === tx.params.recipientAddress; const { isSelfTokenTransferCredit, isIncomingCrossChainTransferTransaction } = tx; const sign = - (isReclaim && isSender) || (isTokenTransfer && isRecipient && !isSelfTransfer) || (isTokenTransfer && isRecipient && isSelfTransfer && isSelfTokenTransferCredit) || isIncomingCrossChainTransferTransaction diff --git a/services/export/shared/transactionsExport.js b/services/export/shared/transactionsExport.js index 04c0e165a..746463fc3 100644 --- a/services/export/shared/transactionsExport.js +++ b/services/export/shared/transactionsExport.js @@ -58,6 +58,8 @@ const { } = require('./helpers/constants'); const { resolveChainIDs, + getBlocks, + getTransactions, getEvents, getAllBlocksInAsc, getAllTransactionsInAsc, @@ -565,7 +567,7 @@ const getEntriesByChronology = async (params, sortedBlocks, sortedTransactions, if (txInList) return txInList; // because transaction may not be available for validator custodial reward reduction in the sorted list - const [txFromIndexer] = (await requestIndexer('transactions', { id: transactionID })).data; + const [txFromIndexer] = (await getTransactions({ id: transactionID })).data; return txFromIndexer; })(); const block = await (async () => { @@ -574,7 +576,7 @@ const getEntriesByChronology = async (params, sortedBlocks, sortedTransactions, if (blockInList) return blockInList; // because block may not be available for validator custodial reward reduction in the sorted list - const [blockFromIndexer] = (await requestIndexer('blocks', { id: blockID })).data; + const [blockFromIndexer] = (await getBlocks({ id: blockID })).data; return blockFromIndexer; })();