From f811c07454c87775f18374e8d955583dc157627f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 25 Jun 2018 12:59:26 +0200 Subject: Move RevertReasons to @0xproject/types package --- packages/types/src/index.ts | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'packages/types') diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index e5a0f41a9..70665a123 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -168,3 +168,47 @@ export interface ERC721AssetData { tokenId: BigNumber; receiverData: string; } + +export enum RevertReasons { + OrderUnfillable = 'ORDER_UNFILLABLE', + InvalidMaker = 'INVALID_MAKER', + InvalidTaker = 'INVALID_TAKER', + InvalidSender = 'INVALID_SENDER', + InvalidOrderSignature = 'INVALID_ORDER_SIGNATURE', + InvalidTakerAmount = 'INVALID_TAKER_AMOUNT', + RoundingError = 'ROUNDING_ERROR', + InvalidSignature = 'INVALID_SIGNATURE', + SignatureIllegal = 'SIGNATURE_ILLEGAL', + SignatureUnsupported = 'SIGNATURE_UNSUPPORTED', + InvalidNewOrderEpoch = 'INVALID_NEW_ORDER_EPOCH', + CompleteFillFailed = 'COMPLETE_FILL_FAILED', + NegativeSpreadRequired = 'NEGATIVE_SPREAD_REQUIRED', + ReentrancyIllegal = 'REENTRANCY_ILLEGAL', + InvalidTxHash = 'INVALID_TX_HASH', + InvalidTxSignature = 'INVALID_TX_SIGNATURE', + FailedExecution = 'FAILED_EXECUTION', + AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', + AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', + LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', + Length0Required = 'LENGTH_0_REQUIRED', + Length65Required = 'LENGTH_65_REQUIRED', + InvalidAmount = 'INVALID_AMOUNT', + TransferFailed = 'TRANSFER_FAILED', + SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED', + TargetNotAuthorized = 'TARGET_NOT_AUTHORIZED', + TargetAlreadyAuthorized = 'TARGET_ALREADY_AUTHORIZED', + IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS', + AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH', + OnlyContractOwner = 'ONLY_CONTRACT_OWNER', + 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', +} -- cgit From 7b0c13c1219fbe2d47b540476eaebb1f6358213d Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Fri, 22 Jun 2018 07:03:42 +0200 Subject: WIP --- packages/types/src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/types') diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index e5a0f41a9..88abdc1e7 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -152,18 +152,18 @@ export interface ECSignature { } export enum AssetProxyId { - INVALID, - ERC20, - ERC721, + INVALID = '0x00000000', + ERC20 = '0xf47261b0', + ERC721 = '0x08e937fa', } export interface ERC20AssetData { - assetProxyId: AssetProxyId; + assetProxyId: string; tokenAddress: string; } export interface ERC721AssetData { - assetProxyId: AssetProxyId; + assetProxyId: string; tokenAddress: string; tokenId: BigNumber; receiverData: string; -- cgit From 27670f4da679f5dbd3a3b399f14ba437184d2633 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 26 Jun 2018 08:11:14 +0200 Subject: Rename RevertReasons to RevertReason since singular enum names are more common --- packages/types/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/types') diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index fa7d91347..423292d45 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -169,7 +169,7 @@ export interface ERC721AssetData { receiverData: string; } -export enum RevertReasons { +export enum RevertReason { OrderUnfillable = 'ORDER_UNFILLABLE', InvalidMaker = 'INVALID_MAKER', InvalidTaker = 'INVALID_TAKER', -- cgit From 7f233dcb15f897a4c7de29987e26143c9d192c01 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 26 Jun 2018 17:34:43 -0700 Subject: Add more revert reasons to tests --- packages/types/src/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/types') diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 423292d45..4b70c36f9 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -190,6 +190,7 @@ export enum RevertReason { AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', + LengthGreaterThan131Required = 'LENGTH_GREATER_THAN_131_REQUIRED', Length0Required = 'LENGTH_0_REQUIRED', Length65Required = 'LENGTH_65_REQUIRED', InvalidAmount = 'INVALID_AMOUNT', -- cgit From d4852092b84936a7c2db207899321ad2a1955e64 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Fri, 29 Jun 2018 14:34:46 -0700 Subject: Make registerAssetProxy append only --- packages/types/src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/types') diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4b70c36f9..4ad10fdee 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -187,8 +187,7 @@ export enum RevertReason { InvalidTxHash = 'INVALID_TX_HASH', InvalidTxSignature = 'INVALID_TX_SIGNATURE', FailedExecution = 'FAILED_EXECUTION', - AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', - AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', + AssetProxyAlreadyExists = 'ASSET_PROXY_ALREADY_EXISTS', LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', LengthGreaterThan131Required = 'LENGTH_GREATER_THAN_131_REQUIRED', Length0Required = 'LENGTH_0_REQUIRED', -- cgit