Skip to content

Commit

Permalink
Fix filtered Wrap/Unrwap Events
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktl-XV committed Dec 7, 2023
1 parent 4f6a0b0 commit be1de3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/filters/wrap_unwrap_native_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit be1de3f

Please sign in to comment.