aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-09-08 02:59:15 +0800
committerDan Finlay <dan@danfinlay.com>2017-09-08 02:59:15 +0800
commitb6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a (patch)
tree2302ceb24fbd71fcfd041ca3939e305fd29b4c19 /test
parent74f7fc4613d136b57a4395d273ce4bf52d6685db (diff)
downloadtangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar.gz
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar.bz2
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar.lz
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar.xz
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.tar.zst
tangerine-wallet-browser-b6e8791bc2bc912d874edcc92fcf3c4ce5a9b72a.zip
test not passing
Diffstat (limited to 'test')
-rw-r--r--test/unit/pending-balance-test.js35
1 files changed, 32 insertions, 3 deletions
diff --git a/test/unit/pending-balance-test.js b/test/unit/pending-balance-test.js
index dcf1926f0..9077e8f14 100644
--- a/test/unit/pending-balance-test.js
+++ b/test/unit/pending-balance-test.js
@@ -5,20 +5,49 @@ const BN = require('ethereumjs-util').BN
let providerResultStub = {}
describe('PendingBalanceCalculator', function () {
- let nonceTracker
+ let balanceCalculator
describe('if you have no pending txs and one ether', function () {
const ether = '0x' + (new BN(String(1e18))).toString(16)
beforeEach(function () {
- nonceTracker = generateBalaneCalcWith([], ether)
+ balanceCalculator = generateBalaneCalcWith([], ether)
})
it('returns the network balance', async function () {
- const result = await nonceTracker.getBalance()
+ const result = await balanceCalculator.getBalance()
assert.equal(result, ether, `gave ${result} needed ${ether}`)
})
})
+
+ describe('if you have a one ether pending tx and one ether', function () {
+ const ether = '0x' + (new BN(String(1e18))).toString(16)
+
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ pendingTxs = txGen.generate({
+ status: 'submitted',
+ txParams: {
+ value: ether,
+ gasPrice: '0x0',
+ gas: '0x0',
+ }
+ }, { count: 1 })
+
+ balanceCalculator = generateBalaneCalcWith(pendingTxs, ether)
+ })
+
+ it('returns the network balance', async function () {
+ console.log('one')
+ console.dir(balanceCalculator)
+ const result = await balanceCalculator.getBalance()
+ console.log('two')
+ console.dir(result)
+ assert.equal(result, '0x0', `gave ${result} needed '0x0'`)
+ return true
+ })
+
+ })
})
function generateBalaneCalcWith (transactions, providerStub = '0x0') {