Add test for computing gas price

feature/default_network_editable
Dan Finlay 7 years ago
parent c616581001
commit 532a4040de
  1. 16
      test/unit/pending-balance-test.js

@ -27,6 +27,22 @@ describe('PendingBalanceCalculator', function () {
const result = balanceCalculator.valueFor(pendingTxs[0]) const result = balanceCalculator.valueFor(pendingTxs[0])
assert.equal(result.toString(), etherBn.toString(), 'computes one ether') assert.equal(result.toString(), etherBn.toString(), 'computes one ether')
}) })
it('calculates gas costs as well', function () {
const txGen = new MockTxGen()
pendingTxs = txGen.generate({
status: 'submitted',
txParams: {
value: '0x0',
gasPrice: '0x2',
gas: '0x3',
}
}, { count: 1 })
const balanceCalculator = generateBalanceCalcWith([], zeroBn)
const result = balanceCalculator.valueFor(pendingTxs[0])
assert.equal(result.toString(), '6', 'computes one ether')
})
}) })
describe('if you have no pending txs and one ether', function () { describe('if you have no pending txs and one ether', function () {

Loading…
Cancel
Save