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/erc20_proxy_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/erc20_proxy_wrapper.ts')
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts index 459019877..369e27e19 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts @@ -6,6 +6,7 @@ import { ContractAbi } from 'ethereum-types'; import * as _ from 'lodash'; import { assert } from '../utils/assert'; +import { _getDefaultContractAddresses } from '../utils/contract_addresses'; import { ContractWrapper } from './contract_wrapper'; @@ -25,7 +26,7 @@ export class ERC20ProxyWrapper extends ContractWrapper { */ constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) { super(web3Wrapper, networkId); - this.address = _.isUndefined(address) ? this._getDefaultContractAddresses().erc20Proxy : address; + this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).erc20Proxy : address; } /** * Get the 4 bytes ID of this asset proxy |