chore: tslint fix

This commit is contained in:
Fabio Berger 2018-10-17 18:23:06 +01:00
parent 87fabbb943
commit bdae4ba2a2
4 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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),
);

View File

@ -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);