Skip to content

Commit

Permalink
parse log on tx confirmation should not fail
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Feb 20, 2020
1 parent 908a33d commit 89ac9f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { UnsignedTransaction } from "@ethersproject/transactions";

import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
import { LogDescription } from "@ethersproject/abi/lib/interface";
const logger = new Logger(version);

export interface Overrides {
Expand Down Expand Up @@ -240,7 +241,10 @@ function runMethod(contract: Contract, functionName: string, options: RunOptions
receipt.events = receipt.logs.map((log) => {
let event: Event = (<Event>deepCopy(log));

let parsed = contract.interface.parseLog(log);
let parsed: LogDescription;
try {
parsed = contract.interface.parseLog(log);
} catch (e){}
if (parsed) {
event.args = parsed.args;
event.decode = (data: BytesLike, topics?: Array<any>) => {
Expand Down

0 comments on commit 89ac9f4

Please sign in to comment.