diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 01:29:46 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 01:29:46 +0800 |
commit | 96615749f9f48be11cdaff15307315687820ce5c (patch) | |
tree | c90f742b397159ff934831350942c085ee8578cf | |
parent | 6e01cf9a5a319f3f3543955fa9f9d673b2c06a82 (diff) | |
download | dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar.gz dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar.bz2 dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar.lz dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar.xz dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.tar.zst dexon-sol-tools-96615749f9f48be11cdaff15307315687820ce5c.zip |
Add signedOrdersScxhema
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 4 | ||||
-rw-r--r-- | src/schemas/signed_orders_schema.ts | 5 |
2 files changed, 9 insertions, 0 deletions
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'}, +}; |