From 3d627e869bb7ba1dc0316ad179f9fff07e5cb83c Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 27 Dec 2017 17:26:38 -0800 Subject: [PATCH] Add test for edge case. --- test/unit/util_test.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 () {