diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-11 07:52:35 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 04:38:59 +0800 |
commit | c83dec22c9e70cec2b75c9e5051f37124baa2761 (patch) | |
tree | 755433a9924bc818f0b4759795a349c4cd7b0dee /packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts | |
parent | 974ec23ecd2a445523e0550c0a7f69329d6959f1 (diff) | |
download | dexon-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/forwarder_wrapper.ts')
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts index fe4d0cbda..fd7a9a362 100644 --- a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts @@ -7,12 +7,12 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { ContractAbi } from 'ethereum-types'; import * as _ from 'lodash'; -import { orderTxOptsSchema } from '../schemas/order_tx_opts_schema'; import { txOptsSchema } from '../schemas/tx_opts_schema'; import { OrderTransactionOpts } from '../types'; import { assert } from '../utils/assert'; import { calldataOptimizationUtils } from '../utils/calldata_optimization_utils'; import { constants } from '../utils/constants'; +import { _getDefaultContractAddresses } from '../utils/contract_addresses'; import { decorators } from '../utils/decorators'; import { utils } from '../utils/utils'; @@ -49,12 +49,12 @@ export class ForwarderWrapper extends ContractWrapper { etherTokenAddress?: string, ) { super(web3Wrapper, networkId); - this.address = _.isUndefined(address) ? this._getDefaultContractAddresses().exchange : address; + this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).exchange : address; this.zrxTokenAddress = _.isUndefined(zrxTokenAddress) - ? this._getDefaultContractAddresses().zrxToken + ? _getDefaultContractAddresses(networkId).zrxToken : zrxTokenAddress; this.etherTokenAddress = _.isUndefined(etherTokenAddress) - ? this._getDefaultContractAddresses().etherToken + ? _getDefaultContractAddresses(networkId).etherToken : etherTokenAddress; } /** |