diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 03:50:03 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 05:15:47 +0800 |
commit | 52007e5864a545c76e0a58cdc82fc8107167526b (patch) | |
tree | b2ffb60e01a462afcbb7b90896ff68ef2e4d5257 /packages/0x.js | |
parent | 0c74d5ba0157429f7f4651dcfe750bf00360962c (diff) | |
download | dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar.gz dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar.bz2 dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar.lz dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar.xz dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.tar.zst dexon-sol-tools-52007e5864a545c76e0a58cdc82fc8107167526b.zip |
Reuse the protected function to get contract address
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 883cc0f49..637c27361 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -705,16 +705,8 @@ export class ExchangeWrapper extends ContractWrapper { * @returns The Ethereum address of the Exchange contract being used. */ public getContractAddress(): string { - const networkId = this._web3Wrapper.getNetworkId(); - if (_.isUndefined(this._contractAddressIfExists)) { - const contractAddress = artifacts.ExchangeArtifact.networks[networkId].address; - if (_.isUndefined(contractAddress)) { - throw new Error(ZeroExError.ExchangeContractDoesNotExist); - } - return contractAddress; - } else { - return this._contractAddressIfExists; - } + const contractAddress = this._getContractAddress(artifacts.ExchangeArtifact, this._contractAddressIfExists); + return contractAddress; } /** * Checks if order is still fillable and throws an error otherwise. Useful for orderbook |