aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-18 00:09:35 +0800
committerFabio Berger <me@fabioberger.com>2018-10-18 00:09:35 +0800
commit852f50d1a0e2d7f6c95231406c8604f9e56dc1dc (patch)
tree29a7f5a26c8e5935894f9082378519b89153179f
parentf3f97896ed647c457d4ab5f5f5e732cebe629c3a (diff)
downloaddexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.gz
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.bz2
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.lz
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.xz
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.tar.zst
dexon-sol-tools-852f50d1a0e2d7f6c95231406c8604f9e56dc1dc.zip
chore: Re-cast to EventAbi after checking the the type is set to 'event'
-rw-r--r--packages/utils/src/abi_decoder.ts7
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,
};
}
});