aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-12-28 09:26:38 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-12-28 09:26:38 +0800
commit3d627e869bb7ba1dc0316ad179f9fff07e5cb83c (patch)
treeae47071acd2da7f2819f255965476f2dc755ff94
parent06f496310ce7d719bbb5690f307db143ba57a1a7 (diff)
downloadtangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar.gz
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar.bz2
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar.lz
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar.xz
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.tar.zst
tangerine-wallet-browser-3d627e869bb7ba1dc0316ad179f9fff07e5cb83c.zip
Add test for edge case.
-rw-r--r--test/unit/util_test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js
index 3a8b6bdfd..1d6e38c5d 100644
--- a/test/unit/util_test.js
+++ b/test/unit/util_test.js
@@ -201,6 +201,12 @@ describe('util', function () {
var output = util.normalizeEthStringToWei(input)
assert.equal(output.toString(10), ethInWei)
})
+
+ it('should account for overflow numbers gracefully by dropping extra precision.', function () {
+ var input = '1.11111111111111111111'
+ var output = util.normalizeEthStringToWei(input)
+ assert.equal(output.toString(10), '1111111111111111111')
+ })
})
describe('#normalizeNumberToWei', function () {