From 87fabbb943779d868d29c437f078a341cb177b2b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 17 Oct 2018 17:36:21 +0100 Subject: chore: Fix remaining necessary casts --- packages/sol-compiler/src/utils/encoder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/sol-compiler/src/utils') diff --git a/packages/sol-compiler/src/utils/encoder.ts b/packages/sol-compiler/src/utils/encoder.ts index 0f2d75691..6527304d6 100644 --- a/packages/sol-compiler/src/utils/encoder.ts +++ b/packages/sol-compiler/src/utils/encoder.ts @@ -1,4 +1,4 @@ -import { AbiDefinition, AbiType, ContractAbi, DataItem } from 'ethereum-types'; +import { AbiDefinition, AbiType, ConstructorAbi, ContractAbi, DataItem } from 'ethereum-types'; import * as _ from 'lodash'; import * as web3Abi from 'web3-eth-abi'; @@ -7,7 +7,8 @@ export const encoder = { const constructorTypes: string[] = []; _.each(abi, (element: AbiDefinition) => { if (element.type === AbiType.Constructor) { - _.each(element.inputs, (input: DataItem) => { + const constuctorAbi = element as ConstructorAbi; + _.each(constuctorAbi.inputs, (input: DataItem) => { constructorTypes.push(input.type); }); } -- cgit v1.2.3 From bdae4ba2a2c9b7b3b41c352c628cb11cd4a1f295 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 17 Oct 2018 18:23:06 +0100 Subject: chore: tslint fix --- packages/sol-compiler/src/utils/encoder.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/sol-compiler/src/utils') diff --git a/packages/sol-compiler/src/utils/encoder.ts b/packages/sol-compiler/src/utils/encoder.ts index 6527304d6..40b103fd5 100644 --- a/packages/sol-compiler/src/utils/encoder.ts +++ b/packages/sol-compiler/src/utils/encoder.ts @@ -7,6 +7,7 @@ export const encoder = { const constructorTypes: string[] = []; _.each(abi, (element: AbiDefinition) => { if (element.type === AbiType.Constructor) { + // tslint:disable-next-line:no-unnecessary-type-assertion const constuctorAbi = element as ConstructorAbi; _.each(constuctorAbi.inputs, (input: DataItem) => { constructorTypes.push(input.type); -- cgit v1.2.3