diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-23 00:36:15 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-23 00:36:15 +0800 |
commit | 0e7c254b938045f0c6e0a57c78bb1db8a23557b6 (patch) | |
tree | e32e823d1bb6116cad5d431f0297ea15aa3fc6ce /packages/contracts/src/utils | |
parent | ba14850c9a3f774169db1b67446618bb84daae54 (diff) | |
download | dexon-sol-tools-0e7c254b938045f0c6e0a57c78bb1db8a23557b6.tar.gz dexon-sol-tools-0e7c254b938045f0c6e0a57c78bb1db8a23557b6.tar.zst dexon-sol-tools-0e7c254b938045f0c6e0a57c78bb1db8a23557b6.zip |
Move constants over to ContractLibError enum and update all tests
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r-- | packages/contracts/src/utils/constants.ts | 13 | ||||
-rw-r--r-- | packages/contracts/src/utils/types.ts | 12 |
2 files changed, 10 insertions, 15 deletions
diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts index f21b8c7a0..2b2bd2425 100644 --- a/packages/contracts/src/utils/constants.ts +++ b/packages/contracts/src/utils/constants.ts @@ -19,19 +19,6 @@ const TESTRPC_PRIVATE_KEYS_STRINGS = [ export const constants = { INVALID_OPCODE: 'invalid opcode', REVERT: 'revert', - LIB_BYTES_GREATER_THAN_ZERO_LENGTH_REQUIRED: 'GREATER_THAN_ZERO_LENGTH_REQUIRED', - LIB_BYTES_GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED', - LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED', - LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED', - LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED', - LIB_BYTES_GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED', - ERC20_INSUFFICIENT_BALANCE: 'Insufficient balance to complete transfer.', - ERC20_INSUFFICIENT_ALLOWANCE: 'Insufficient allowance to complete transfer.', - EXCHANGE_LENGTH_GREATER_THAN_0_REQUIRED: 'LENGTH_GREATER_THAN_0_REQUIRED', - EXCHANGE_SIGNATURE_UNSUPPORTED: 'SIGNATURE_UNSUPPORTED', - EXCHANGE_SIGNATURE_ILLEGAL: 'SIGNATURE_ILLEGAL', - EXCHANGE_LENGTH_0_REQUIRED: 'LENGTH_0_REQUIRED', - EXCHANGE_LENGTH_65_REQUIRED: 'LENGTH_65_REQUIRED', TESTRPC_NETWORK_ID: 50, // Note(albrow): In practice V8 and most other engines limit the minimum // interval for setInterval to 10ms. We still set it to 0 here in order to diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 43c9109e7..f65a9858b 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -173,8 +173,8 @@ export enum ContractLibErrors { AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', - Length1Required = 'LENGTH_1_REQUIRED', - Length66Required = 'LENGTH_66_REQUIRED', + ExchangeLength0Required = 'LENGTH_0_REQUIRED', + ExchangeLength65Required = 'LENGTH_65_REQUIRED', InvalidAmount = 'INVALID_AMOUNT', TransferFailed = 'TRANSFER_FAILED', SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED', @@ -186,4 +186,12 @@ export enum ContractLibErrors { MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED', TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED', AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST', + LibBytesGreaterThanZeroLengthRequired = 'GREATER_THAN_ZERO_LENGTH_REQUIRED', + LibBytesGreaterOrEqualTo4LengthRequired = 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED', + LibBytesGreaterOrEqualTo20LengthRequired = 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED', + LibBytesGreaterOrEqualTo32LengthRequired = 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED', + LibBytesGreaterOrEqualToNestedBytesLengthRequired = 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED', + LibBytesGreaterOrEqualToSourceBytesLengthRequired = 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED', + Erc20InsufficientBalance = 'ERC20_INSUFFICIENT_BALANCE', + Erc20InsufficientAllowance = 'ERC20_INSUFFICIENT_ALLOWANCE', } |