From be1de3ff13a5fde0dc0c678c25fe0571ea1b2e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20P=C3=A9rez?= Date: Thu, 7 Dec 2023 16:39:15 +0100 Subject: [PATCH] Fix filtered Wrap/Unrwap Events --- src/filters/wrap_unwrap_native_events.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/filters/wrap_unwrap_native_events.ts b/src/filters/wrap_unwrap_native_events.ts index 58761b45..2e15c6d5 100644 --- a/src/filters/wrap_unwrap_native_events.ts +++ b/src/filters/wrap_unwrap_native_events.ts @@ -11,9 +11,11 @@ export async function filterWrapUnwrapEvents(events: Event[], web3Source: Web3So if (events.length > 0) { const txHashes = events.map((log: Event) => log.transactionHash); const txData = await getParseTxsAsync(web3Source, txHashes); - const filteredTxs = txData.parsedTxs.filter((tx: Transaction) => tx.affiliateAddress); + const filteredTxsHashes = txData.parsedTxs + .filter((tx: Transaction) => tx.affiliateAddress) + .map((tx: Transaction) => tx.transactionHash); - const validTxHashSet = new Set(txHashes); + const validTxHashSet = new Set(filteredTxsHashes); const filteredLogs = events.filter((log: Event) => validTxHashSet.has(log.transactionHash)); return filteredLogs; }