mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add test for computing gas price
This commit is contained in:
parent
c616581001
commit
532a4040de
@ -27,6 +27,22 @@ describe('PendingBalanceCalculator', function () {
|
||||
const result = balanceCalculator.valueFor(pendingTxs[0])
|
||||
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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user