diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-18 20:07:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 20:07:19 +0800 |
commit | bf653327638149816769027b0fde2d2e44a6fed0 (patch) | |
tree | 954985c17cf11eb5321b48a377523565bbf09733 /packages/assert | |
parent | e6fe728bcbbab0c500fc7adee1439505282e8eca (diff) | |
parent | 3973dec9944a10c62ec6c3d15d973a00a6ea45a6 (diff) | |
download | dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar.gz dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar.bz2 dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar.lz dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar.xz dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.tar.zst dexon-0x-contracts-bf653327638149816769027b0fde2d2e44a6fed0.zip |
Merge branch 'development' into feature/new-ganache
Diffstat (limited to 'packages/assert')
-rw-r--r-- | packages/assert/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/assert/src/index.ts | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index 0210f9400..278b7dfa1 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, + { "timestamp": 1547561734, "version": "1.0.23", "changes": [ diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index 2d28d51e1..741bd78e1 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -7,12 +7,12 @@ const HEX_REGEX = /^0x[0-9A-F]*$/i; export const assert = { isBigNumber(variableName: string, value: BigNumber): void { - const isBigNumber = _.isObject(value) && (value as any).isBigNumber; + const isBigNumber = BigNumber.isBigNumber(value); assert.assert(isBigNumber, assert.typeAssertionMessage(variableName, 'BigNumber', value)); }, isValidBaseUnitAmount(variableName: string, value: BigNumber): void { assert.isBigNumber(variableName, value); - const isNegative = value.lessThan(0); + const isNegative = value.isLessThan(0); assert.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`); const hasDecimals = value.decimalPlaces() !== 0; assert.assert( |