diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-11-11 08:53:47 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-11-11 08:53:47 +0800 |
commit | f665b779cbc0f503198e67c5e10bccd2e0e0d2bb (patch) | |
tree | 71e1657d744f8fbf3f55a70d713d6a7701833a9f /test | |
parent | 161ff62fdcf6f76f7243a1e865dd0cccbc89121f (diff) | |
parent | 3775a4bf799efc99cfe3d46b35fc0b39a82c94c2 (diff) | |
download | tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar.gz tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar.bz2 tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar.lz tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar.xz tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.tar.zst tangerine-wallet-browser-f665b779cbc0f503198e67c5e10bccd2e0e0d2bb.zip |
Merge branch 'master' into i328-MultiVault
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/idStore-test.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 46b3d4809..064483ba0 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -159,7 +159,7 @@ describe('IdentityStore', function() { assert.equal(result.indexOf('0x'), 0, 'include hex prefix') }) - it('buffers reasonably', function() { + it('buffers 20%', function() { const idStore = new IdentityStore({ configManager: configManagerGen(), ethStore: { @@ -168,20 +168,18 @@ describe('IdentityStore', function() { }) const gas = '0x04ee59' // Actual estimated gas example - const tooBigOutput = '0x80674f9' // Actual bad output const bnGas = new BN(ethUtil.stripHexPrefix(gas), 16) - const correctBuffer = new BN('100000', 10) + const five = new BN('5', 10) + const correctBuffer = bnGas.div(five) const correct = bnGas.add(correctBuffer) - const tooBig = new BN(tooBigOutput, 16) const result = idStore.addGasBuffer(gas) const bnResult = new BN(ethUtil.stripHexPrefix(result), 16) assert.equal(result.indexOf('0x'), 0, 'included hex prefix') assert(bnResult.gt(bnGas), 'Estimate increased in value.') - assert.equal(bnResult.sub(bnGas).toString(10), '100000', 'added 100k gas') + assert.equal(bnResult.sub(bnGas).toString(10), correctBuffer.toString(10), 'added 20% gas') assert.equal(result, '0x' + correct.toString(16), 'Added the right amount') - assert.notEqual(result, tooBigOutput, 'not that bad estimate') }) }) |