aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-20 05:46:50 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-20 05:46:50 +0800
commit60270de53d214edffad7b90356bbe06081a55443 (patch)
tree67a648b43cbb604507ccd793e9a44cbbe24deb23 /test
parent22a77b80411350bd844313b51ea58312940b9738 (diff)
downloadtangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar.gz
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar.bz2
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar.lz
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar.xz
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.tar.zst
tangerine-wallet-browser-60270de53d214edffad7b90356bbe06081a55443.zip
Add full precision to send tx value field.
Diffstat (limited to 'test')
-rw-r--r--test/unit/util_test.js14
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() {