diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-07 17:50:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-07 17:50:23 +0800 |
commit | 491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1 (patch) | |
tree | 24b40ba936b87c8428ecfbccf91f7159690a873c /src/utils | |
parent | 498cc6cea12d9c7d2bb1af6b50f5609efb074734 (diff) | |
download | dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar.gz dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar.bz2 dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar.lz dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar.xz dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.tar.zst dexon-sol-tools-491a6e3c04c3d9a63930eaeba6fb4632f3ae9cb1.zip |
Add initial implementation of batchCancelAsync
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/assert.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 4dc6945a2..3842185bb 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -42,6 +42,12 @@ export const assert = { const availableAddresses = await web3Wrapper.getAvailableAddressesAsync(); this.assert(!_.isEmpty(availableAddresses), 'No addresses were available on the provided web3 instance'); }, + isSameLength(variableName1: string, value1: any[], variableName2: string, value2: any[]) { + const length1 = value1.length; + const length2 = value2.length; + this.assert(length1 === length2, `${variableName1} and ${variableName2} length mismatch. + ${length1} != ${length2}`); + }, isNumber(variableName: string, value: number): void { this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value)); }, |