aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-01 20:46:09 +0800
committerFabio Berger <me@fabioberger.com>2017-06-01 20:46:09 +0800
commitc74b16eda9465104e1969b1635ac826835d203eb (patch)
treeecf750865f425d65a830fb786359ad07451a805c /src/0x.js.ts
parent0991191a9b6c00fac80cd9f5ffa8e76c62f82eb5 (diff)
downloaddexon-0x-contracts-c74b16eda9465104e1969b1635ac826835d203eb.tar.gz
dexon-0x-contracts-c74b16eda9465104e1969b1635ac826835d203eb.tar.zst
dexon-0x-contracts-c74b16eda9465104e1969b1635ac826835d203eb.zip
Add convertToJSONSchemaCompatibleObject method
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index e5eb6b520..92a5d2c54 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -11,6 +11,7 @@ import {Web3Wrapper} from './web3_wrapper';
import {constants} from './utils/constants';
import {utils} from './utils/utils';
import {assert} from './utils/assert';
+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 = [