aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:27:31 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:27:31 +0800
commitb1c7291d3cfffb11a13c50a518f2b895bcdc9fc5 (patch)
tree72fe9bb7fc42e4dc3ec6c55483d7acb1406da8eb /src/0x.ts
parent5611df82f9f276fb161fa268f7ab468a6c1d7784 (diff)
downloaddexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.gz
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.bz2
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.lz
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.xz
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.tar.zst
dexon-sol-tools-b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5.zip
Use orderHashSchema to validate order hash
Diffstat (limited to 'src/0x.ts')
-rw-r--r--src/0x.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/0x.ts b/src/0x.ts
index 1b9334942..d42c16ca6 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -17,7 +17,8 @@ import {ecSignatureSchema} from './schemas/ec_signature_schema';
import {TokenWrapper} from './contract_wrappers/token_wrapper';
import {ProxyWrapper} from './contract_wrappers/proxy_wrapper';
import {ECSignature, ZeroExError, Order, SignedOrder, Web3Provider} from './types';
-import {orderSchema} from './schemas/order_schemas';
+import {orderSchema, orderHashSchema} from './schemas/order_schemas';
+import {SchemaValidator} from './utils/schema_validator';
// Customize our BigNumber instances
bigNumberConfigs.configure();
@@ -110,7 +111,8 @@ export class ZeroEx {
// Since this method can be called to check if any arbitrary string conforms to an orderHash's
// format, we only assert that we were indeed passed a string.
assert.isString('orderHash', orderHash);
- const isValidOrderHash = utils.isValidOrderHash(orderHash);
+ const schemaValidator = new SchemaValidator();
+ const isValidOrderHash = schemaValidator.validate(orderHash, orderHashSchema).valid;
return isValidOrderHash;
}
/**