ran linter
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { addHexPrefix, stripHexPrefix, sha3 } from 'ethereumjs-util';
|
import { addHexPrefix, sha3, stripHexPrefix } from 'ethereumjs-util';
|
||||||
import * as jsSHA3 from 'js-sha3';
|
import * as jsSHA3 from 'js-sha3';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
@@ -63,7 +63,8 @@ export const addressUtils = {
|
|||||||
generatePseudoRandomAddress(): string {
|
generatePseudoRandomAddress(): string {
|
||||||
const randomBigNum = addressUtils.generatePseudoRandomSalt();
|
const randomBigNum = addressUtils.generatePseudoRandomSalt();
|
||||||
const randomBuff = sha3(randomBigNum.toString());
|
const randomBuff = sha3(randomBigNum.toString());
|
||||||
const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`;
|
const addressLengthInBytes = 20;
|
||||||
|
const randomAddress = `0x${randomBuff.slice(0, addressLengthInBytes).toString('hex')}`;
|
||||||
return randomAddress;
|
return randomAddress;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,9 +36,11 @@ export class TransactionDecoder {
|
|||||||
deploymentInfos?: DeployedContractInfo[],
|
deploymentInfos?: DeployedContractInfo[],
|
||||||
): void {
|
): void {
|
||||||
// Disregard definitions that are not functions
|
// Disregard definitions that are not functions
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
const functionAbis = _.filter(abiDefinitions, abiEntry => {
|
const functionAbis = _.filter(abiDefinitions, abiEntry => {
|
||||||
return abiEntry.type === 'function';
|
return abiEntry.type === 'function';
|
||||||
}) as MethodAbi[];
|
}) as MethodAbi[];
|
||||||
|
// tslint:enable no-unnecessary-type-assertion
|
||||||
// Record function ABI's
|
// Record function ABI's
|
||||||
_.each(functionAbis, functionAbi => {
|
_.each(functionAbis, functionAbi => {
|
||||||
const abiEncoder = new AbiEncoder.Method(functionAbi);
|
const abiEncoder = new AbiEncoder.Method(functionAbi);
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import * as chai from 'chai';
|
|||||||
import { MethodAbi } from 'ethereum-types';
|
import { MethodAbi } from 'ethereum-types';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
|
||||||
import { AbiEncoder, TransactionDecoder } from '../src';
|
import { AbiEncoder, TransactionDecoder } from '../src';
|
||||||
|
|
||||||
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user