Prevent malformed logs from preventing other logs being decoded (#4275).

This commit is contained in:
Richard Moore 2023-07-28 14:48:55 -04:00
parent 3a52201fe2
commit 0dca645632

@ -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;
});
}