diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-11-23 05:09:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-23 05:09:18 +0800 |
commit | 785fef3449e1377c3a6dd7b17e60fda765cd5156 (patch) | |
tree | ca121f1e43cd3cf823999449ccc04ff9b3854f4a /test/unit/idStore-test.js | |
parent | b9d73a4b8fd8aa88aa1cf51e8305db9809dd7b9d (diff) | |
parent | 49a1f43736a209f4d003a1bebe35defe281296b1 (diff) | |
download | tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar.gz tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar.bz2 tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar.lz tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar.xz tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.tar.zst tangerine-wallet-browser-785fef3449e1377c3a6dd7b17e60fda765cd5156.zip |
Merge pull request #872 from MetaMask/i868-estimateGasTooHigh
Improve gas estimation logic
Diffstat (limited to 'test/unit/idStore-test.js')
-rw-r--r-- | test/unit/idStore-test.js | 9 |
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') }) }) |