diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 15:11:58 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 15:23:43 +0800 |
commit | 5bdfad9b415fc183102d5f5a7f3a08782921f003 (patch) | |
tree | dbb5635bf678e59126f07bd69364cfda43374a1c /packages/contract-wrappers/src | |
parent | 3c5812c5d20e98475ef8ce47b949596656f46a0d (diff) | |
download | dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar.gz dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar.bz2 dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar.lz dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar.xz dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.tar.zst dexon-sol-tools-5bdfad9b415fc183102d5f5a7f3a08782921f003.zip |
Remove ContractNotFound errors in contract-wrappers
Diffstat (limited to 'packages/contract-wrappers/src')
4 files changed, 0 insertions, 26 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts index 97043bd19..192eaf0a7 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts @@ -428,12 +428,6 @@ export class ERC20TokenWrapper extends ContractWrapper { if (!_.isUndefined(tokenContract)) { return tokenContract; } - // TODO(albrow): Do we really still need this check? The default error - // looks okay to me. - const doesContractExist = await this._web3Wrapper.doesContractExistAtAddressAsync(tokenAddress); - if (!doesContractExist) { - throw new Error(ContractWrappersError.ERC20TokenContractDoesNotExist); - } const contractInstance = new ERC20TokenContract( this.abi, normalizedTokenAddress, diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts index a59801b41..d92d7087c 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts @@ -455,12 +455,6 @@ export class ERC721TokenWrapper extends ContractWrapper { if (!_.isUndefined(tokenContract)) { return tokenContract; } - // TODO(albrow): Do we really still need this check? The default error - // looks okay to me. - const doesContractExist = await this._web3Wrapper.doesContractExistAtAddressAsync(tokenAddress); - if (!doesContractExist) { - throw new Error(ContractWrappersError.ERC721TokenContractDoesNotExist); - } const contractInstance = new ERC721TokenContract( this.abi, normalizedTokenAddress, diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts index 8bb27369f..d5775208e 100644 --- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts @@ -197,13 +197,6 @@ export class EtherTokenWrapper extends ContractWrapper { if (!_.isUndefined(etherTokenContract)) { return etherTokenContract; } - // TODO(albrow): Do we really still need this check? The default error - // looks okay to me. - // TODO(albrow): Should we normalize the token address here? - const doesContractExist = await this._web3Wrapper.doesContractExistAtAddressAsync(etherTokenAddress); - if (!doesContractExist) { - throw new Error(ContractWrappersError.EtherTokenContractDoesNotExist); - } const contractInstance = new WETH9Contract( this.abi, etherTokenAddress, diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts index e70adb991..895a47cc1 100644 --- a/packages/contract-wrappers/src/types.ts +++ b/packages/contract-wrappers/src/types.ts @@ -19,13 +19,6 @@ export enum ExchangeWrapperError { } export enum ContractWrappersError { - ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST', - ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST', - EtherTokenContractDoesNotExist = 'ETHER_TOKEN_CONTRACT_DOES_NOT_EXIST', - ERC20ProxyContractDoesNotExist = 'ERC20_PROXY_CONTRACT_DOES_NOT_EXIST', - ERC721ProxyContractDoesNotExist = 'ERC721_PROXY_CONTRACT_DOES_NOT_EXIST', - ERC20TokenContractDoesNotExist = 'ERC20_TOKEN_CONTRACT_DOES_NOT_EXIST', - ERC721TokenContractDoesNotExist = 'ERC721_TOKEN_CONTRACT_DOES_NOT_EXIST', ContractNotDeployedOnNetwork = 'CONTRACT_NOT_DEPLOYED_ON_NETWORK', InsufficientAllowanceForTransfer = 'INSUFFICIENT_ALLOWANCE_FOR_TRANSFER', InsufficientBalanceForTransfer = 'INSUFFICIENT_BALANCE_FOR_TRANSFER', |