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/base-contract/src/index.ts | 2 +- packages/sol-compiler/src/utils/encoder.ts | 1 + packages/sol-doc/src/sol_doc.ts | 4 ++++ packages/utils/src/abi_decoder.ts | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 354362d45..73550ffd4 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -1,6 +1,5 @@ import { abiUtils, BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { FunctionAbi } from 'ethereum-protocol'; import { AbiDefinition, AbiType, @@ -130,6 +129,7 @@ export class BaseContract { if (abiDefinition.type !== AbiType.Function) { return false; } + // tslint:disable-next-line:no-unnecessary-type-assertion const abiFunctionSignature = abiUtils.getFunctionSignature(abiDefinition as MethodAbi); if (abiFunctionSignature === functionSignature) { return true; 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); diff --git a/packages/sol-doc/src/sol_doc.ts b/packages/sol-doc/src/sol_doc.ts index 35ba2c6e8..686e9ca34 100644 --- a/packages/sol-doc/src/sol_doc.ts +++ b/packages/sol-doc/src/sol_doc.ts @@ -324,18 +324,22 @@ export class SolDoc { switch (abiDefinition.type) { case 'constructor': docSection.constructors.push( + // tslint:disable-next-line:no-unnecessary-type-assertion this._genConstructorDoc(contractName, abiDefinition as ConstructorAbi, compiledContract.devdoc), ); break; case 'event': + // tslint:disable-next-line:no-unnecessary-type-assertion (docSection.events as Event[]).push(SolDoc._genEventDoc(abiDefinition as EventAbi)); // note that we're not sending devdoc to this._genEventDoc(). // that's because the type of the events array doesn't have any fields for documentation! break; case 'function': + // tslint:disable-next-line:no-unnecessary-type-assertion docSection.methods.push(this._genMethodDoc(abiDefinition as MethodAbi, compiledContract.devdoc)); break; case 'fallback': + // tslint:disable-next-line:no-unnecessary-type-assertion docSection.methods.push( SolDoc._genFallbackDoc(abiDefinition as FallbackAbi, compiledContract.devdoc), ); diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 9cc863909..c0b2c7950 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -99,6 +99,7 @@ export class AbiDecoder { const ethersInterface = new ethers.utils.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { + // 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); -- cgit