Skip to content

Commit 0dca645

Browse files
committed
Prevent malformed logs from preventing other logs being decoded (#4275).
1 parent 3a52201 commit 0dca645

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src.ts/contract/wrappers.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ export class ContractTransactionReceipt extends TransactionReceipt {
7676
return super.logs.map((log) => {
7777
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]): null;
7878
if (fragment) {
79-
return new EventLog(log, this.#iface, fragment)
80-
} else {
81-
return log;
79+
try {
80+
return new EventLog(log, this.#iface, fragment)
81+
} catch (error) { }
8282
}
83+
84+
return log;
8385
});
8486
}
8587

0 commit comments

Comments
 (0)