diff options
author | Fabio Berger <me@fabioberger.com> | 2017-05-31 16:35:40 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-05-31 16:35:40 +0800 |
commit | 03072049d67f460e2420ed5e05a91ab1c06972ac (patch) | |
tree | 15291703d1e0562e41bac8a8a8adac5efdd07043 | |
parent | d1d66f563581c7f56d4956903cfb1b23d149cf18 (diff) | |
download | dexon-0x-contracts-03072049d67f460e2420ed5e05a91ab1c06972ac.tar.gz dexon-0x-contracts-03072049d67f460e2420ed5e05a91ab1c06972ac.tar.zst dexon-0x-contracts-03072049d67f460e2420ed5e05a91ab1c06972ac.zip |
remove InternalError type since this error could surface through the public interface
-rw-r--r-- | src/contract_wrappers/token_wrapper.ts | 4 | ||||
-rw-r--r-- | src/types.ts | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts index 928b67a03..35e008905 100644 --- a/src/contract_wrappers/token_wrapper.ts +++ b/src/contract_wrappers/token_wrapper.ts @@ -6,7 +6,7 @@ import {constants} from '../utils/constants'; import {ContractWrapper} from './contract_wrapper'; import * as TokenArtifacts from '../artifacts/Token.json'; import * as ProxyArtifacts from '../artifacts/Proxy.json'; -import {TokenContract, InternalError} from '../types'; +import {TokenContract, ZeroExError} from '../types'; const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 45730; @@ -85,7 +85,7 @@ export class TokenWrapper extends ContractWrapper { undefined : (ProxyArtifacts as any).networks[networkIdIfExists]; if (_.isUndefined(proxyNetworkConfigsIfExists)) { - throw new Error(InternalError.PROXY_ADDRESS_NOT_FOUND); + throw new Error(ZeroExError.CONTRACT_NOT_DEPLOYED_ON_NETWORK); } const proxyAddress = proxyNetworkConfigsIfExists.address; return proxyAddress; diff --git a/src/types.ts b/src/types.ts index bf0a1d8b4..caef50993 100644 --- a/src/types.ts +++ b/src/types.ts @@ -14,14 +14,10 @@ export const ZeroExError = strEnum([ 'UNHANDLED_ERROR', 'USER_HAS_NO_ASSOCIATED_ADDRESSES', 'INVALID_SIGNATURE', + 'CONTRACT_NOT_DEPLOYED_ON_NETWORK', ]); export type ZeroExError = keyof typeof ZeroExError; -export const InternalError = strEnum([ - 'PROXY_ADDRESS_NOT_FOUND', -]); -export type InternalError = keyof typeof InternalError; - /** * Elliptic Curve signature */ |