aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index f2093b745..92a5d2c54 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -5,12 +5,13 @@ import * as ethUtil from 'ethereumjs-util';
import contract = require('truffle-contract');
import * as Web3 from 'web3';
import * as ethABI from 'ethereumjs-abi';
+import findVersions = require('find-versions');
+import compareVersions = require('compare-versions');
import {Web3Wrapper} from './web3_wrapper';
import {constants} from './utils/constants';
import {utils} from './utils/utils';
import {assert} from './utils/assert';
-import findVersions = require('find-versions');
-import compareVersions = require('compare-versions');
+import {SchemaValidator} from './utils/schema_validator';
import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper';
import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper';
import {ecSignatureSchema} from './schemas/ec_signature_schema';
@@ -33,7 +34,9 @@ export class ZeroEx {
* Computes the orderHash given the order parameters and returns it as a hex encoded string.
*/
public static getOrderHashHex(exchangeContractAddr: string, order: Order): string {
- assert.doesConformToSchema('order', JSON.parse(JSON.stringify(order)), orderSchema);
+ assert.doesConformToSchema('order',
+ SchemaValidator.convertToJSONSchemaCompatibleObject(order as object),
+ orderSchema);
const taker = _.isEmpty(order.taker) ? constants.NULL_ADDRESS : order.taker ;
const orderParts = [