diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-01-03 06:04:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 06:04:27 +0800 |
commit | 25d0ac147668e45da43a4dd74876e3e22bd6a246 (patch) | |
tree | 6a81531e5398afc26685e7b0523c7526dabd0f7f /test/unit/idStore-test.js | |
parent | edc5f9e821bf18fa6ec984e645790fba3457d0bb (diff) | |
parent | fb002dc44eae82e0471b8b52acecc61ba5f39332 (diff) | |
download | tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar.gz tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar.bz2 tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar.lz tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar.xz tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.tar.zst tangerine-wallet-browser-25d0ac147668e45da43a4dd74876e3e22bd6a246.zip |
Merge branch 'dev' into ShowDifferentAccounts
Diffstat (limited to 'test/unit/idStore-test.js')
-rw-r--r-- | test/unit/idStore-test.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 3ca89cd38..000c58a82 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -139,54 +139,4 @@ describe('IdentityStore', function() { }) }) }) - - describe('#addGasBuffer', function() { - it('formats the result correctly', 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 bnResult = idStore.addGasBuffer(bnGas) - - assert.ok(bnResult.gt(gas), 'added more gas as buffer.') - }) - - it('buffers 20%', function() { - const idStore = new IdentityStore({ - configManager: configManagerGen(), - ethStore: { - addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) }, - }, - }) - - const gas = '0x04ee59' // Actual estimated gas example - const bnGas = new BN(ethUtil.stripHexPrefix(gas), 16) - const five = new BN('5', 10) - const correctBuffer = bnGas.div(five) - const correct = bnGas.add(correctBuffer) - - const bnResult = idStore.addGasBuffer(bnGas) - - assert(bnResult.gt(bnGas), 'Estimate increased in value.') - assert.equal(bnResult.sub(bnGas).toString(10), correctBuffer.toString(10), 'added 20% gas') - }) - }) - - describe('#checkForDelegateCall', function() { - const idStore = new IdentityStore({ - configManager: configManagerGen(), - ethStore: { - addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) }, - }, - }) - - var result = idStore.checkForDelegateCall(delegateCallCode) - assert.equal(result, true, 'no delegate call in provided code') - }) - }) |