diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-03 02:39:02 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-03 02:39:02 +0800 |
commit | 36e937f8de348cfdb35ff8f72504aed1dfab07b2 (patch) | |
tree | e8e0ba5b603f07bddf6cd01329e001b06b5987dd /src/utils/assert.ts | |
parent | c6ceb44682a19c9f53505803547fcb2012691b5b (diff) | |
parent | 5925f81fe185a90efaa82dd90bd8d65d74326f11 (diff) | |
download | dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.gz dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.bz2 dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.lz dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.xz dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.zst dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.zip |
Merge branch 'master' into remainingTokenMethods
# Conflicts:
# src/contract_wrappers/token_wrapper.ts
Diffstat (limited to 'src/utils/assert.ts')
-rw-r--r-- | src/utils/assert.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 446974b10..5a31e1b16 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -3,6 +3,7 @@ import * as BigNumber from 'bignumber.js'; import * as Web3 from 'web3'; import {Web3Wrapper} from '../web3_wrapper'; import {SchemaValidator} from './schema_validator'; +import {utils} from './utils'; const HEX_REGEX = /^0x[0-9A-F]*$/i; @@ -33,6 +34,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)); }, |