diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-16 03:52:49 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-05-16 03:52:49 +0800 |
commit | 9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a (patch) | |
tree | f72aae5170b6f1f6d3d70ebf6c03ed171680ff50 /packages/contracts/src/utils/log_decoder.ts | |
parent | 9744b1906a111aa0c65c8fafb4db66aef32a5a23 (diff) | |
parent | 6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff) | |
download | dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.gz dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.zst dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.zip |
Merge branch 'development' into v2-prototype
Diffstat (limited to 'packages/contracts/src/utils/log_decoder.ts')
-rw-r--r-- | packages/contracts/src/utils/log_decoder.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts index 291b85dd2..747c7644d 100644 --- a/packages/contracts/src/utils/log_decoder.ts +++ b/packages/contracts/src/utils/log_decoder.ts @@ -1,9 +1,9 @@ +import { ContractArtifact } from '@0xproject/sol-compiler'; import { AbiDefinition, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types'; import { AbiDecoder, BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import { artifacts } from './artifacts'; -import { Artifact } from './types'; export class LogDecoder { private _abiDecoder: AbiDecoder; @@ -12,12 +12,9 @@ export class LogDecoder { throw new Error('networkId not specified'); } const abiArrays: AbiDefinition[][] = []; - _.forEach(artifacts, (artifact: Artifact) => { - const networkIfExists = artifact.networks[networkIdIfExists]; - if (_.isUndefined(networkIfExists)) { - throw new Error(`Artifact does not exist on network ${networkIdIfExists}`); - } - abiArrays.push(networkIfExists.abi); + _.forEach(artifacts, (artifact: ContractArtifact) => { + const compilerOutput = artifact.compilerOutput; + abiArrays.push(compilerOutput.abi); }); this._abiDecoder = new AbiDecoder(abiArrays); } |