diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-06-09 23:55:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 23:55:22 +0800 |
commit | 604ed46c140c67abde7735b808b79b8d26868d0b (patch) | |
tree | 98bbb15dad405b9d0db4aaf4e1480cf1c7f679d3 /src/utils | |
parent | 135df646782d7e08a83dabc25ad31b06c5765cf1 (diff) | |
parent | 3a9d07c40ce2e26203962487036132d6357ec530 (diff) | |
download | dexon-0x-contracts-604ed46c140c67abde7735b808b79b8d26868d0b.tar.gz dexon-0x-contracts-604ed46c140c67abde7735b808b79b8d26868d0b.tar.zst dexon-0x-contracts-604ed46c140c67abde7735b808b79b8d26868d0b.zip |
Merge branch 'master' into schema-tests
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/assert.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts index d93ac71f7..94b119d5a 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -38,6 +38,9 @@ export const assert = { const availableAddresses = await web3Wrapper.getAvailableAddressesAsync(); this.assert(!_.isEmpty(availableAddresses), 'No addresses were available on the provided web3 instance'); }, + hasAtMostOneUniqueValue(value: any[], errMsg: string): void { + this.assert(_.uniq(value).length <= 1, errMsg); + }, isNumber(variableName: string, value: number): void { this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value)); }, |