aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 01:29:46 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 01:29:46 +0800
commit96615749f9f48be11cdaff15307315687820ce5c (patch)
treec90f742b397159ff934831350942c085ee8578cf /src
parent6e01cf9a5a319f3f3543955fa9f9d673b2c06a82 (diff)
downloaddexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar.gz
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar.bz2
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar.lz
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar.xz
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.tar.zst
dexon-0x-contracts-96615749f9f48be11cdaff15307315687820ce5c.zip
Add signedOrdersScxhema
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--src/schemas/signed_orders_schema.ts5
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'},
+};