diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-02-12 12:02:54 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:16 +0800 |
commit | df99a360fb3467b80952416ed1d1802f3599ee8d (patch) | |
tree | 86f2982184635bdcb9a74a7d24409f92ad133dc6 /packages/contracts/src/utils/log_decoder.ts | |
parent | 4c76ad072a043253085fc0f08f47afb30bb6f834 (diff) | |
download | dexon-sol-tools-df99a360fb3467b80952416ed1d1802f3599ee8d.tar.gz dexon-sol-tools-df99a360fb3467b80952416ed1d1802f3599ee8d.tar.zst dexon-sol-tools-df99a360fb3467b80952416ed1d1802f3599ee8d.zip |
Rename variables
Diffstat (limited to 'packages/contracts/src/utils/log_decoder.ts')
-rw-r--r-- | packages/contracts/src/utils/log_decoder.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts index 98dd8eab6..89f641078 100644 --- a/packages/contracts/src/utils/log_decoder.ts +++ b/packages/contracts/src/utils/log_decoder.ts @@ -8,17 +8,17 @@ import { Artifact } from './types'; export class LogDecoder { private _abiDecoder: AbiDecoder; - constructor(networkId: number) { - if (_.isUndefined(networkId)) { + constructor(networkIdIfExists?: number) { + if (_.isUndefined(networkIdIfExists)) { throw new Error('networkId not specified'); } const abiArrays: Web3.AbiDefinition[][] = []; _.forEach(artifacts, (artifact: Artifact) => { - const network = artifact.networks[networkId]; - if (_.isUndefined(network)) { - throw new Error(`Artifact does not exist on network ${networkId}`); + const networkIfExists = artifact.networks[networkIdIfExists]; + if (_.isUndefined(networkIfExists)) { + throw new Error(`Artifact does not exist on network ${networkIdIfExists}`); } - abiArrays.push(network.abi); + abiArrays.push(networkIfExists.abi); }); this._abiDecoder = new AbiDecoder(abiArrays); } |