aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-20 05:21:35 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-20 05:21:35 +0800
commit22a77b80411350bd844313b51ea58312940b9738 (patch)
tree757461fdb573045b2d870fd52d57064ee28335f1 /test
parent43a948e94b03e3c4b9f888650a798f5c5d77ae1e (diff)
downloadtangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar.gz
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar.bz2
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar.lz
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar.xz
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.tar.zst
tangerine-wallet-browser-22a77b80411350bd844313b51ea58312940b9738.zip
Increase send value precision
Diffstat (limited to 'test')
-rw-r--r--test/unit/util_test.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js
index 020fad783..5f28dbb25 100644
--- a/test/unit/util_test.js
+++ b/test/unit/util_test.js
@@ -61,6 +61,7 @@ describe('util', function() {
var result = util.isValidAddress(address)
assert.ok(!result)
})
+
})
describe('numericBalance', function() {
@@ -160,6 +161,13 @@ describe('util', function() {
describe('#normalizeNumberToWei', function() {
+ it('should handle a simple use case', function() {
+ var input = 0.0002
+ var output = util.normalizeNumberToWei(input, 'ether')
+ var str = output.toString(10)
+ assert.equal(str, '200000000000000')
+ })
+
it('should convert a kwei number to the appropriate equivalent wei', function() {
var result = util.normalizeNumberToWei(1.111, 'kwei')
assert.equal(result.toString(10), '1111', 'accepts decimals')