Skip to content

Commit

Permalink
Fix log parsing when no matching topic is found (#733).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 25, 2020
1 parent 89ac9f4 commit 4b8e198
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/abi/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, JsonFragmentType, ParamType } from "./fragments";
import { AbiCoder, CoerceFunc, defaultAbiCoder } from "./abi-coder";
import { Indexed, Interface, Result } from "./interface";
import { Indexed, Interface, LogDescription, Result, TransactionDescription } from "./interface";

export {
ConstructorFragment,
Expand All @@ -25,5 +25,8 @@ export {
JsonFragment,
JsonFragmentType,

Result
Result,

LogDescription,
TransactionDescription
};
6 changes: 3 additions & 3 deletions packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

import { EventFragment, Fragment, Indexed, Interface, JsonFragment, ParamType, Result } from "@ethersproject/abi";
import { EventFragment, Fragment, Indexed, Interface, JsonFragment, LogDescription, ParamType, Result } from "@ethersproject/abi";
import { Block, BlockTag, Filter, FilterByBlockHash, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer, VoidSigner } from "@ethersproject/abstract-signer";
import { getContractAddress } from "@ethersproject/address";
Expand All @@ -12,7 +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 @@ -241,7 +241,7 @@ function runMethod(contract: Contract, functionName: string, options: RunOptions
receipt.events = receipt.logs.map((log) => {
let event: Event = (<Event>deepCopy(log));

let parsed: LogDescription;
let parsed: LogDescription = null;
try {
parsed = contract.interface.parseLog(log);
} catch (e){}
Expand Down

0 comments on commit 4b8e198

Please sign in to comment.