Skip to content

Commit

Permalink
Store failed tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktl-XV committed Jan 18, 2024
1 parent ab18dec commit 769c6e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scripts/pull_and_save_block_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ function parseTransactionEvents(transaction: FullTransaction): ParsedTransaction
};
});

const foundScrapedEventInTx = nestedParsedEvents.map((npe) => npe.events).flat().length > 0;

return {
parsedTransaction: nestedParsedEvents.map((npe) => npe.events).flat().length > 0 ? parsedTransaction : null,
// We need all reverted txs for joining with traces later
// toString is needed because we libraries do not match
parsedTransaction:
foundScrapedEventInTx || transaction.status!.toString() === 'false' ? parsedTransaction : null,
parsedEvents: nestedParsedEvents,
};
}
Expand Down

0 comments on commit 769c6e0

Please sign in to comment.