mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove logs
This commit is contained in:
parent
a95a3c7e4f
commit
c616581001
@ -15,7 +15,6 @@ class PendingBalanceCalculator {
|
||||
}
|
||||
|
||||
async getBalance() {
|
||||
console.log('getting balance')
|
||||
const results = await Promise.all([
|
||||
this.getNetworkBalance(),
|
||||
this.getPendingTransactions(),
|
||||
@ -24,23 +23,16 @@ class PendingBalanceCalculator {
|
||||
const balance = results[0]
|
||||
const pending = results[1]
|
||||
|
||||
console.dir(pending)
|
||||
console.dir(balance.toString())
|
||||
console.trace('but why')
|
||||
|
||||
const pendingValue = pending.reduce((total, tx) => {
|
||||
return total.add(this.valueFor(tx))
|
||||
}, new BN(0))
|
||||
|
||||
console.log(`subtracting ${pendingValue.toString()} from ${balance.toString()}`)
|
||||
|
||||
return `0x${ balance.sub(pendingValue).toString(16) }`
|
||||
}
|
||||
|
||||
valueFor (tx) {
|
||||
const txValue = tx.txParams.value
|
||||
const normalized = normalize(txValue).substring(2)
|
||||
console.log({ txValue, normalized })
|
||||
const value = this.hexToBn(txValue)
|
||||
return value
|
||||
}
|
||||
|
@ -57,12 +57,7 @@ describe('PendingBalanceCalculator', function () {
|
||||
})
|
||||
|
||||
it('returns the network balance', async function () {
|
||||
console.log('one')
|
||||
console.dir(balanceCalculator)
|
||||
console.dir(balanceCalculator.getBalance.toString())
|
||||
const result = await balanceCalculator.getBalance()
|
||||
console.log('two')
|
||||
console.dir(result)
|
||||
assert.equal(result, '0x0', `gave ${result} needed '0x0'`)
|
||||
return true
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user