Skip to content
Snippets Groups Projects

[mod] #377 money.py : document show_amount_from_pubkey()

Merged matograine requested to merge 377_document_show_amount into dev
1 file
+ 9
5
Compare changes
  • Side-by-side
  • Inline
+ 9
5
@@ -77,7 +77,11 @@ async def cmd_amount(ctx, pubkeys):
@@ -77,7 +77,11 @@ async def cmd_amount(ctx, pubkeys):
await client.close()
await client.close()
async def show_amount_from_pubkey(pubkey, inputs_balance):
async def show_amount_from_pubkey(label, inputs_balance):
 
"""
 
Shows the balance of a pubkey.
 
`label` can be either a pubkey or "Total".
 
"""
totalAmountInput = inputs_balance[0]
totalAmountInput = inputs_balance[0]
balance = inputs_balance[1]
balance = inputs_balance[1]
currency_symbol = await CurrencySymbol().symbol
currency_symbol = await CurrencySymbol().symbol
@@ -86,12 +90,12 @@ async def show_amount_from_pubkey(pubkey, inputs_balance):
@@ -86,12 +90,12 @@ async def show_amount_from_pubkey(pubkey, inputs_balance):
member = False
member = False
# if `pubkey` is a pubkey, get pubkey:checksum and uid
# if `pubkey` is a pubkey, get pubkey:checksum and uid
if pubkey != "Total":
if label != "Total":
member = await wot.is_member(pubkey)
member = await wot.is_member(label)
pubkey = display_pubkey_and_checksum(pubkey)
pubkey_and_ck = display_pubkey_and_checksum(label)
# display balance table
# display balance table
display = list()
display = list()
display.append(["Balance of pubkey", pubkey])
display.append(["Balance of pubkey", pubkey_and_ck])
if member:
if member:
display.append(["User identifier", member["uid"]])
display.append(["User identifier", member["uid"]])
Loading