From 5bdfad9b415fc183102d5f5a7f3a08782921f003 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 16 Oct 2018 00:11:58 -0700 Subject: Remove ContractNotFound errors in contract-wrappers --- .../contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts | 6 ------ .../src/contract_wrappers/erc721_token_wrapper.ts | 6 ------ .../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts | 7 ------- packages/contract-wrappers/src/types.ts | 7 ------- 4 files changed, 26 deletions(-) (limited to 'packages/contract-wrappers/src') 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', -- cgit