aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts12
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