diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/util_test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js index 5f28dbb25..b091d5bc7 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -159,6 +159,20 @@ describe('util', function() { }) }) + describe('normalizeEthStringToWei', function() { + it('should convert decimal eth to pure wei BN', function() { + var input = '1.23456789' + var output = util.normalizeEthStringToWei(input) + assert.equal(output.toString(10), '1234567890000000000') + }) + + it('should convert 1 to expected wei', function() { + var input = '1' + var output = util.normalizeEthStringToWei(input) + assert.equal(output.toString(10), ethInWei) + }) + }) + describe('#normalizeNumberToWei', function() { it('should handle a simple use case', function() { |