added tests to /balance, minor cleanup

This commit is contained in:
Samuel Husso
2017-10-29 10:10:00 +02:00
parent dd78c62c3d
commit 4f6c3f94e0
2 changed files with 23 additions and 5 deletions

View File

@@ -208,19 +208,18 @@ def _balance(bot: Bot, update: Update) -> None:
Hander for /balance
Returns current account balance per crypto
"""
filter = {'Currency', 'CryptoAddress'}
output = ""
balances = exchange.get_balances()
for c in balances:
# output[c['Currency']] = {k: c[k] for k in c.keys() & {*set(c) - set(filter)}}
for currency in balances:
output += """*Currency*: {Currency}
*Available*: {Available}
*Balance*: {Balance}
*Pending*: {Pending}
""".format(**c)
""".format(**currency)
send_msg(output)
@authorized_only
@@ -347,6 +346,7 @@ def _help(bot: Bot, update: Update) -> None:
*/profit:* `Lists cumulative profit from all finished trades`
*/forcesell <trade_id>:* `Instantly sells the given trade, regardless of profit`
*/performance:* `Show performance of each finished trade grouped by pair`
*/balance:* `Show account balance per currency`
*/help:* `This help message`
"""
send_msg(message, bot=bot)