diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-10-18 04:33:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 04:33:02 +0800 |
commit | 0f0951ba549c294222421ef8508294165e9b5fdd (patch) | |
tree | 1c14d688553014175c7fb4fe8c5e0f88048f0db5 /test/unit | |
parent | 101e839f9a254891d9c32a6b4660252506ead04c (diff) | |
parent | 827d7553fc843a75b7a4306c7549505f799609d7 (diff) | |
download | tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar.gz tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar.bz2 tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar.lz tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar.xz tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.tar.zst tangerine-wallet-browser-0f0951ba549c294222421ef8508294165e9b5fdd.zip |
Merge pull request #744 from MetaMask/i738-IncreaseGas
Increase gas estimate by 100000 wei
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/idStore-test.js | 18 |
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') + }) }) |