aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-18 03:47:37 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-18 03:47:37 +0800
commit91f43fa2130e84a32ebecf902696a0b897cdd095 (patch)
treeb68ae90f5aef6c1b0cbc612be57df7a12edce40c /test
parent101e839f9a254891d9c32a6b4660252506ead04c (diff)
downloadtangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar.gz
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar.bz2
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar.lz
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar.xz
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.tar.zst
tangerine-wallet-browser-91f43fa2130e84a32ebecf902696a0b897cdd095.zip
Increase gas estimate by 100000 wei
To prevent minor gas estimation errors, probably usually related to operating on dynamic state. Fixes #738.
Diffstat (limited to 'test')
-rw-r--r--test/unit/idStore-test.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js
index 31da2cd3d..7f6324645 100644
--- a/test/unit/idStore-test.js
+++ b/test/unit/idStore-test.js
@@ -2,6 +2,7 @@ var assert = require('assert')
var IdentityStore = require('../../app/scripts/lib/idStore')
var configManagerGen = require('../lib/mock-config-manager')
const ethUtil = require('ethereumjs-util')
+const BN = ethUtil.BN
const async = require('async')
describe('IdentityStore', function() {
@@ -138,4 +139,20 @@ describe('IdentityStore', function() {
})
})
})
+
+ describe('#addGasBuffer', function() {
+ const idStore = new IdentityStore({
+ configManager: configManagerGen(),
+ ethStore: {
+ addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) },
+ },
+ })
+
+ const gas = '0x01'
+ const bnGas = new BN(gas, 16)
+ const result = idStore.addGasBuffer(gas)
+ const bnResult = new BN(result, 16)
+
+ assert.ok(bnResult.gt(gas), 'added more gas as buffer.')
+ })
})