aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 18:20:28 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 18:20:28 +0800
commit09f67322f1548b77ea3835b8a885e8c538835af8 (patch)
tree54db087854438cc7b55cbb9bd8f27bbf0c56a0df /src/0x.js.ts
parent9a2a79a947eeb9f839a381d1ee27cad872636438 (diff)
downloaddexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar.gz
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar.bz2
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar.lz
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar.xz
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.tar.zst
dexon-sol-tools-09f67322f1548b77ea3835b8a885e8c538835af8.zip
Remove assertions from utils methods
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index fa52d4ad8..7b53b70ea 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -16,6 +16,8 @@ import {ecSignatureSchema} from './schemas/ec_signature_schema';
import {TokenWrapper} from './contract_wrappers/token_wrapper';
import {ECSignature, ZeroExError, Order, SignedOrder} from './types';
import * as ExchangeArtifacts from './artifacts/Exchange.json';
+import {SchemaValidator} from './utils/schema_validator';
+import {orderSchema} from './schemas/order_schemas';
// Customize our BigNumber instances
bigNumberConfigs.configure();
@@ -128,6 +130,8 @@ export class ZeroEx {
* Computes the orderHash for a given order and returns it as a hex encoded string.
*/
public async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
+ assert.doesConformToSchema(
+ 'order', SchemaValidator.convertToJSONSchemaCompatibleObject(order as object), orderSchema);
const exchangeContractAddr = await this.getExchangeAddressAsync();
const hashHex = utils.getOrderHashHex(order, exchangeContractAddr);
return hashHex;