From 22160df2d2d5aef63c3e2c3f502ac15119b18e07 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 9 Oct 2018 12:55:10 +0200 Subject: Fix ethers build issue --- packages/base-contract/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/base-contract') diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 981e6fca6..7e0428d92 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -12,12 +12,13 @@ import { TxDataPayable, } from 'ethereum-types'; import * as ethers from 'ethers'; +import { Interface } from 'ethers/utils/interface'; import * as _ from 'lodash'; import { formatABIDataItem } from './utils'; export interface EthersInterfaceByFunctionSignature { - [key: string]: ethers.Interface; + [key: string]: Interface; } const REVERT_ERROR_SELECTOR = '08c379a0'; @@ -101,7 +102,7 @@ export class BaseContract { // if it overflows the corresponding Solidity type, there is a bug in the // encoder, or the encoder performs unsafe type coercion. public static strictArgumentEncodingCheck(inputAbi: DataItem[], args: any[]): void { - const coder = new ethers.AbiCoder(); + const coder = new ethers.utils.AbiCoder(); const params = abiUtils.parseEthersParams(inputAbi); const rawEncoded = coder.encode(inputAbi, args); const rawDecoded = coder.decode(inputAbi, rawEncoded); @@ -117,7 +118,7 @@ export class BaseContract { } } } - protected _lookupEthersInterface(functionSignature: string): ethers.Interface { + protected _lookupEthersInterface(functionSignature: string): Interface { const ethersInterface = this._ethersInterfacesByFunctionSignature[functionSignature]; if (_.isUndefined(ethersInterface)) { throw new Error(`Failed to lookup method with function signature '${functionSignature}'`); @@ -154,7 +155,7 @@ export class BaseContract { this._ethersInterfacesByFunctionSignature = {}; _.each(methodAbis, methodAbi => { const functionSignature = abiUtils.getFunctionSignature(methodAbi); - this._ethersInterfacesByFunctionSignature[functionSignature] = new ethers.Interface([methodAbi]); + this._ethersInterfacesByFunctionSignature[functionSignature] = new Interface([methodAbi]); }); } } -- cgit v1.2.3