aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/assert.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-03 01:53:01 +0800
committerGitHub <noreply@github.com>2017-06-03 01:53:01 +0800
commit5925f81fe185a90efaa82dd90bd8d65d74326f11 (patch)
tree12daf7aec686c576634b2daa5a58af2831cc497d /src/utils/assert.ts
parent2ff8f4ca6ed238f331cb69aaeb912a94b3df901e (diff)
parent35c9330d6246183509a3543cdf1278b9ced191e2 (diff)
downloaddexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.gz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.bz2
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.lz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.xz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.zst
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.zip
Merge pull request #31 from 0xProject/unavailableFilledCancelled
Implement Unavailable, Filled and Cancelled
Diffstat (limited to 'src/utils/assert.ts')
-rw-r--r--src/utils/assert.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index aeed1c6dc..406f2b149 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -2,6 +2,7 @@ import * as _ from 'lodash';
import * as BigNumber from 'bignumber.js';
import * as Web3 from 'web3';
import {SchemaValidator} from './schema_validator';
+import {utils} from './utils';
const HEX_REGEX = /^0x[0-9A-F]*$/i;
@@ -27,6 +28,9 @@ export const assert = {
isNumber(variableName: string, value: number): void {
this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value));
},
+ isValidOrderHash(variableName: string, value: string): void {
+ this.assert(utils.isValidOrderHash(value), this.typeAssertionMessage(variableName, 'orderHash', value));
+ },
isBoolean(variableName: string, value: boolean): void {
this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value));
},