aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-11-23 04:10:49 +0800
committerkumavis <aaron@kumavis.me>2016-11-23 04:10:49 +0800
commitfa2f0dee285d4a9032f8a756ee8711a7fe767b76 (patch)
tree7cc0eef90cb686ef00edbcc136969cd91bfa9879 /test
parent1142d7104821b0ee51b46ef27042ad53b7309e8d (diff)
downloadtangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar.gz
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar.bz2
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar.lz
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar.xz
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.tar.zst
tangerine-wallet-browser-fa2f0dee285d4a9032f8a756ee8711a7fe767b76.zip
idStore - fix estimateGas calculation
Diffstat (limited to 'test')
-rw-r--r--test/unit/idStore-test.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js
index 064483ba0..bf8270540 100644
--- a/test/unit/idStore-test.js
+++ b/test/unit/idStore-test.js
@@ -152,11 +152,9 @@ describe('IdentityStore', function() {
const gas = '0x01'
const bnGas = new BN(gas, 16)
- const result = idStore.addGasBuffer(gas)
- const bnResult = new BN(result, 16)
+ const bnResult = idStore.addGasBuffer(bnGas)
assert.ok(bnResult.gt(gas), 'added more gas as buffer.')
- assert.equal(result.indexOf('0x'), 0, 'include hex prefix')
})
it('buffers 20%', function() {
@@ -173,13 +171,10 @@ describe('IdentityStore', function() {
const correctBuffer = bnGas.div(five)
const correct = bnGas.add(correctBuffer)
- const result = idStore.addGasBuffer(gas)
- const bnResult = new BN(ethUtil.stripHexPrefix(result), 16)
+ const bnResult = idStore.addGasBuffer(bnGas)
- assert.equal(result.indexOf('0x'), 0, 'included hex prefix')
assert(bnResult.gt(bnGas), 'Estimate increased in value.')
assert.equal(bnResult.sub(bnGas).toString(10), correctBuffer.toString(10), 'added 20% gas')
- assert.equal(result, '0x' + correct.toString(16), 'Added the right amount')
})
})