aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-10-20 05:57:30 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-10-20 05:57:30 +0800
commitafbc4c832ba86fcb94b612c93796a5ffa422b457 (patch)
treedbdaa16920fd175171603b182d332dbf87655bd4 /test
parentad3fa24a28c0ec45dca43a257005626a4027487a (diff)
parenta88a48ba14a213920ce1becb0b70cf10192ad3e5 (diff)
downloadtangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar.gz
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar.bz2
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar.lz
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar.xz
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.tar.zst
tangerine-wallet-browser-afbc4c832ba86fcb94b612c93796a5ffa422b457.zip
Git merge resolution.
Diffstat (limited to 'test')
-rw-r--r--test/unit/idStore-test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js
index 31da2cd3d..0a57d2121 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,21 @@ 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.')
+ assert.equal(result.indexOf('0x'), 0, 'include hex prefix')
+ })
})