diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-18 00:09:35 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-18 00:09:35 +0800 |
commit | 852f50d1a0e2d7f6c95231406c8604f9e56dc1dc (patch) | |
tree | 29a7f5a26c8e5935894f9082378519b89153179f /packages/utils/src/abi_decoder.ts | |
parent | f3f97896ed647c457d4ab5f5f5e732cebe629c3a (diff) | |
download | dexon-0x-contracts-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.gz dexon-0x-contracts-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.zst dexon-0x-contracts-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.zip |
chore: Re-cast to EventAbi after checking the the type is set to 'event'
Diffstat (limited to 'packages/utils/src/abi_decoder.ts')
-rw-r--r-- | packages/utils/src/abi_decoder.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ac3e54efb..9cc863909 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -99,11 +99,12 @@ 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); + 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, }; } }); |