Interface for EventDescription renamed topics

This commit is contained in:
Jacob Evans
2018-04-19 16:11:10 +10:00
parent d186f6148b
commit 4bee63afc6
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ declare module 'ethers' {
parse: (...args: any[]) => any;
inputs: { names: string[]; types: string[] };
signature: string;
topic: string;
topics: string[];
}
export class Interface {
public functions: { [functionName: string]: FunctionDescription };

View File

@@ -80,7 +80,7 @@ export class AbiDecoder {
const ethersInterface = new ethers.Interface(abiArray);
_.map(abiArray, (abi: AbiDefinition) => {
if (abi.type === AbiType.Event) {
const topic = ethersInterface.events[abi.name].topic;
const topic = ethersInterface.events[abi.name].topics[0];
this._methodIds[topic] = abi;
}
});