Move Coordinator EIP712 constants from contracts/test-utils to packages/order-utils.

Export `constants` from `packages/types`.
Add `SignatureInvalid` to `RevertReason` in `packages/types`.
This commit is contained in:
Lawrence Forman
2019-03-15 16:41:41 -04:00
parent 1c1f625352
commit afaabb3673
4 changed files with 15 additions and 10 deletions

View File

@@ -65,14 +65,4 @@ export const constants = {
'CANCEL_ORDERS_UP_TO',
'SET_SIGNATURE_VALIDATOR_APPROVAL',
],
COORDINATOR_DOMAIN_NAME: '0x Protocol Trade Execution Coordinator',
COORDINATOR_DOMAIN_VERSION: '1.0.0',
COORDINATOR_APPROVAL_SCHEMA: {
name: 'COORDINATORApproval',
parameters: [
{ name: 'transactionHash', type: 'bytes32' },
{ name: 'transactionSignature', type: 'bytes' },
{ name: 'approvalExpirationTimeSeconds', type: 'uint256' },
],
},
};

View File

@@ -103,6 +103,17 @@ export const constants = {
{ name: 'data', type: 'bytes' },
],
},
COORDINATOR_DOMAIN_NAME: '0x Protocol Coordinator',
COORDINATOR_DOMAIN_VERSION: '1.0.0',
COORDINATOR_APPROVAL_SCHEMA: {
name: 'CoordinatorApproval',
parameters: [
{ name: 'txOrigin', type: 'address' },
{ name: 'transactionHash', type: 'bytes32' },
{ name: 'transactionSignature', type: 'bytes' },
{ name: 'approvalExpirationTimeSeconds', type: 'uint256' },
],
},
ERC20_METHOD_ABI,
ERC721_METHOD_ABI,
MULTI_ASSET_METHOD_ABI,

View File

@@ -63,6 +63,7 @@ export {
ZeroExTransaction,
SignedZeroExTransaction,
} from '@0x/types';
export {
OrderError,
TradeSide,
@@ -72,3 +73,5 @@ export {
FeeOrdersAndRemainingFeeAmount,
OrdersAndRemainingFillAmount,
} from './types';
export { constants } from './constants';

View File

@@ -204,6 +204,7 @@ export enum RevertReason {
RoundingError = 'ROUNDING_ERROR',
InvalidSignature = 'INVALID_SIGNATURE',
SignatureIllegal = 'SIGNATURE_ILLEGAL',
SignatureInvalid = 'SIGNATURE_INVALID',
SignatureUnsupported = 'SIGNATURE_UNSUPPORTED',
TakerOverpay = 'TAKER_OVERPAY',
OrderOverfill = 'ORDER_OVERFILL',