diff options
author | Kadinsky <kandinsky454@protonmail.ch> | 2018-10-18 02:01:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 02:01:29 +0800 |
commit | 5ec4b27200297708298deca97603849a37b2f66a (patch) | |
tree | 96c28898329c3bf786a08549384f2de79d0903f8 /packages/utils | |
parent | b2012bf1610eda65afe180b04df6c9ee8f5dc659 (diff) | |
parent | bdae4ba2a2c9b7b3b41c352c628cb11cd4a1f295 (diff) | |
download | dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar.gz dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar.bz2 dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar.lz dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar.xz dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.tar.zst dexon-sol-tools-5ec4b27200297708298deca97603849a37b2f66a.zip |
Merge pull request #1145 from 0xProject/refactorSchemasToJSON
Move json-schema schemas to JSON files
Diffstat (limited to 'packages/utils')
-rw-r--r-- | packages/utils/src/abi_decoder.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ac3e54efb..c0b2c7950 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -99,11 +99,13 @@ export class AbiDecoder { const ethersInterface = new ethers.utils.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { - const topic = ethersInterface.events[abi.name].topic; - const numIndexedArgs = _.reduce(abi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); + // tslint:disable-next-line:no-unnecessary-type-assertion + const eventAbi = abi as EventAbi; + const topic = ethersInterface.events[eventAbi.name].topic; + const numIndexedArgs = _.reduce(eventAbi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); this._methodIds[topic] = { ...this._methodIds[topic], - [numIndexedArgs]: abi, + [numIndexedArgs]: eventAbi, }; } }); |