Skip to content

Commit

Permalink
Prevent malformed logs from preventing other logs being decoded (#4275).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 28, 2023
1 parent 3a52201 commit 0dca645
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src.ts/contract/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ export class ContractTransactionReceipt extends TransactionReceipt {
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]): null;
if (fragment) {
return new EventLog(log, this.#iface, fragment)
} else {
return log;
try {
return new EventLog(log, this.#iface, fragment)
} catch (error) { }
}

return log;
});
}

Expand Down

0 comments on commit 0dca645

Please sign in to comment.