aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/idStore-test.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
commit331bb735c7e9db0aa3af66e4a994e6eb9762af81 (patch)
tree6d51948907cbfc0c002bfdc4698ec99fe100e831 /test/unit/idStore-test.js
parent94f25543691b1a26f1b33a9074ba65cb722eff48 (diff)
parent12698b946221c1145d1fe966406adb7265e6b9d2 (diff)
downloadtangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.gz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.zst
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.zip
Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault
Diffstat (limited to 'test/unit/idStore-test.js')
-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')
+ })
})