diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-04-03 06:28:56 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:17 +0800 |
commit | 7a66da5a51603d4d87d644f3635f8c7f1d00bb36 (patch) | |
tree | a633cb75b01eec7a0ea49078ddd412720c6807d3 /packages/contracts/src/utils/log_decoder.ts | |
parent | 3541f5e1dac692fa12fafd4822dc98aa7afe5c1c (diff) | |
download | dexon-sol-tools-7a66da5a51603d4d87d644f3635f8c7f1d00bb36.tar.gz dexon-sol-tools-7a66da5a51603d4d87d644f3635f8c7f1d00bb36.tar.zst dexon-sol-tools-7a66da5a51603d4d87d644f3635f8c7f1d00bb36.zip |
Fix build errors
Diffstat (limited to 'packages/contracts/src/utils/log_decoder.ts')
-rw-r--r-- | packages/contracts/src/utils/log_decoder.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts index 845e025fe..291b85dd2 100644 --- a/packages/contracts/src/utils/log_decoder.ts +++ b/packages/contracts/src/utils/log_decoder.ts @@ -1,7 +1,6 @@ -import { LogWithDecodedArgs, RawLog } from '@0xproject/types'; +import { AbiDefinition, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types'; import { AbiDecoder, BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import { artifacts } from './artifacts'; import { Artifact } from './types'; @@ -12,7 +11,7 @@ export class LogDecoder { if (_.isUndefined(networkIdIfExists)) { throw new Error('networkId not specified'); } - const abiArrays: Web3.AbiDefinition[][] = []; + const abiArrays: AbiDefinition[][] = []; _.forEach(artifacts, (artifact: Artifact) => { const networkIfExists = artifact.networks[networkIdIfExists]; if (_.isUndefined(networkIfExists)) { @@ -22,7 +21,7 @@ export class LogDecoder { }); this._abiDecoder = new AbiDecoder(abiArrays); } - public decodeLogOrThrow<ArgsType>(log: Web3.LogEntry): LogWithDecodedArgs<ArgsType> | RawLog { + public decodeLogOrThrow<ArgsType>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog { const logWithDecodedArgsOrLog = this._abiDecoder.tryToDecodeLogOrNoop(log); if (_.isUndefined((logWithDecodedArgsOrLog as LogWithDecodedArgs<ArgsType>).args)) { throw new Error(`Unable to decode log: ${JSON.stringify(log)}`); |