Skip to content
Snippets Groups Projects
Commit 706d0cc5 authored by Moul's avatar Moul
Browse files

[mod] #172: balance: Properly name variables

To represent what they contain:
- value -> inputs_balance
- amount -> balance
parent 84410535
No related branches found
No related tags found
No related merge requests found
...@@ -48,10 +48,10 @@ async def cmd_amount(ctx, pubkeys): ...@@ -48,10 +48,10 @@ async def cmd_amount(ctx, pubkeys):
return return
total = [0, 0] total = [0, 0]
for pubkey in pubkeys: for pubkey in pubkeys:
value = await get_amount_from_pubkey(pubkey) inputs_balance = await get_amount_from_pubkey(pubkey)
await show_amount_from_pubkey(pubkey, value) await show_amount_from_pubkey(pubkey, inputs_balance)
total[0] += value[0] total[0] += inputs_balance[0]
total[1] += value[1] total[1] += inputs_balance[1]
if len(pubkeys) > 1: if len(pubkeys) > 1:
await show_amount_from_pubkey("Total", total) await show_amount_from_pubkey("Total", total)
else: else:
...@@ -61,21 +61,21 @@ async def cmd_amount(ctx, pubkeys): ...@@ -61,21 +61,21 @@ async def cmd_amount(ctx, pubkeys):
await client.close() await client.close()
async def show_amount_from_pubkey(pubkey, value): async def show_amount_from_pubkey(pubkey, inputs_balance):
totalAmountInput = value[0] totalAmountInput = inputs_balance[0]
amount = value[1] balance = inputs_balance[1]
currency_symbol = await CurrencySymbol().symbol currency_symbol = await CurrencySymbol().symbol
ud_value = await UDValue().ud_value ud_value = await UDValue().ud_value
average, monetary_mass = await get_average() average, monetary_mass = await get_average()
# display balance table # display balance table
display = list() display = list()
display.append(["Balance of pubkey", pubkey]) display.append(["Balance of pubkey", pubkey])
if totalAmountInput - amount != 0: if totalAmountInput - balance != 0:
display_amount(display, "Blockchain", amount, ud_value, currency_symbol) display_amount(display, "Blockchain", amount, ud_value, currency_symbol)
display_amount( display_amount(
display, display,
"Pending transaction", "Pending transaction",
(totalAmountInput - amount), (totalAmountInput - balance),
ud_value, ud_value,
currency_symbol, currency_symbol,
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment