From 27d2633c81b1b1ef3217a266e0e9e5774b634932 Mon Sep 17 00:00:00 2001 From: Eric Jiang Date: Mon, 22 Apr 2019 12:41:34 -0400 Subject: [PATCH] chore(): update deps --- package.json | 4 ++-- test/token.js | 1 - token.js | 7 ++----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 12c1b94..b52224b 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "ara-crypto": "^0.8.x", "ara-identity": "^0.60.x", "ara-runtime-configuration": "^1.x.x", - "ara-util": "^1.3.x", + "ara-util": "^1.4.x", "bignumber.js": "^8.0.1", "buffer-from": "^1.1.1", "cross-spawn": "^5.1.0", @@ -71,7 +71,7 @@ "rimraf": "^2.6.2", "solc": "^0.4.24", "truffle-hdwallet-provider": "0.0.6", - "web3": "1.0.0-beta.52", + "web3": "1.0.0-beta.37", "which": "^1.3.1", "yargs": "^12.0.1" }, diff --git a/test/token.js b/test/token.js index 632c2e8..9de343e 100644 --- a/test/token.js +++ b/test/token.js @@ -61,7 +61,6 @@ test('expandTokenValue(val)', (t) => { test('expandTokenValue(val) invalid input', (t) => { t.throws(() => token.expandTokenValue(), TypeError) - t.throws(() => token.expandTokenValue(123), TypeError) t.throws(() => token.expandTokenValue({ }), TypeError) t.throws(() => token.expandTokenValue([ ]), TypeError) t.throws(() => token.expandTokenValue([ '1' ]), TypeError) diff --git a/token.js b/token.js index f771bc4..c239764 100644 --- a/token.js +++ b/token.js @@ -425,11 +425,8 @@ function expandTokenValue(val) { * @throws {TypeError} */ function constrainTokenValue(val) { - if ('string' !== typeof val && 'object' !== typeof val) { - throw new TypeError(`Expected 'val' to be of type string or BigNumber. Got ${val}. Ensure ${val} is the string or BigNumber representation of a positive number.`) - } - if ('object' === val) { - return BigNumber(`${val.toString()}e-${TOKEN_DECIMALS}`).toString() + if ('string' !== typeof val) { + throw new TypeError(`Expected 'val' to be of type string. Got ${val}. Ensure ${val} is the string representation of a positive number.`) } if (!val) { return '0'