aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/contract_wrappers.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-11 07:52:35 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-10-16 04:38:59 +0800
commitc83dec22c9e70cec2b75c9e5051f37124baa2761 (patch)
tree755433a9924bc818f0b4759795a349c4cd7b0dee /packages/contract-wrappers/src/contract_wrappers.ts
parent974ec23ecd2a445523e0550c0a7f69329d6959f1 (diff)
downloaddexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar.gz
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar.bz2
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar.lz
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar.xz
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.tar.zst
dexon-sol-tools-c83dec22c9e70cec2b75c9e5051f37124baa2761.zip
Improve error handling for unknown network ids in contract-wrappers
Diffstat (limited to 'packages/contract-wrappers/src/contract_wrappers.ts')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers.ts b/packages/contract-wrappers/src/contract_wrappers.ts
index 34eb1f303..8cb322912 100644
--- a/packages/contract-wrappers/src/contract_wrappers.ts
+++ b/packages/contract-wrappers/src/contract_wrappers.ts
@@ -27,6 +27,8 @@ import { contractWrappersPublicNetworkConfigSchema } from './schemas/contract_wr
import { ContractWrappersConfig } from './types';
import { assert } from './utils/assert';
import { constants } from './utils/constants';
+import { _getDefaultContractAddresses } from './utils/contract_addresses';
+
/**
* The ContractWrappers class contains smart contract wrappers helpful when building on 0x protocol.
*/
@@ -102,7 +104,7 @@ export class ContractWrappers {
? constants.DEFAULT_BLOCK_POLLING_INTERVAL
: config.blockPollingIntervalMs;
const contractAddresses = _.isUndefined(config.contractAddresses)
- ? getContractAddressesForNetwork(config.networkId)
+ ? _getDefaultContractAddresses(config.networkId)
: config.contractAddresses;
this.erc20Proxy = new ERC20ProxyWrapper(this._web3Wrapper, config.networkId, contractAddresses.erc20Proxy);
this.erc721Proxy = new ERC721ProxyWrapper(this._web3Wrapper, config.networkId, contractAddresses.erc721Proxy);