From 96615749f9f48be11cdaff15307315687820ce5c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 8 Jun 2017 19:29:46 +0200 Subject: Add signedOrdersScxhema --- src/contract_wrappers/exchange_wrapper.ts | 4 ++++ src/schemas/signed_orders_schema.ts | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 src/schemas/signed_orders_schema.ts (limited to 'src') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index d92f87bd8..943d168c3 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -28,6 +28,7 @@ import {utils} from '../utils/utils'; import {ContractWrapper} from './contract_wrapper'; import * as ExchangeArtifacts from '../artifacts/Exchange.json'; import {ecSignatureSchema} from '../schemas/ec_signature_schema'; +import {signedOrdersSchema} from '../schemas/signed_orders_schema'; import {orderFillOrKillRequestsSchema} from '../schemas/order_fill_or_kill_requests_schema'; import {signedOrderSchema, orderSchema} from '../schemas/order_schemas'; import {SchemaValidator} from '../utils/schema_validator'; @@ -172,6 +173,9 @@ export class ExchangeWrapper extends ContractWrapper { ExchangeContractErrs.MULTIPLE_TAKER_TOKENS_IN_FILL_UP_TO_DISALLOWED); assert.isBigNumber('takerTokenFillAmount', takerTokenFillAmount); assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); + assert.doesConformToSchema( + 'signedOrders', SchemaValidator.convertToJSONSchemaCompatibleObject(signedOrders), signedOrdersSchema + ); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); _.forEach(signedOrders, async (signedOrder: SignedOrder, i: number) => { diff --git a/src/schemas/signed_orders_schema.ts b/src/schemas/signed_orders_schema.ts new file mode 100644 index 000000000..3b3b23649 --- /dev/null +++ b/src/schemas/signed_orders_schema.ts @@ -0,0 +1,5 @@ +export const signedOrdersSchema = { + id: '/signedOrdersSchema', + type: 'array', + items: {$ref: '/signedOrderSchema'}, +}; -- cgit v1.2.3