From 7b98ee33a38d5cd94f329569fc6f2e92c137cefe Mon Sep 17 00:00:00 2001 From: lza_menace Date: Sat, 8 May 2021 00:45:25 -0700 Subject: [PATCH] making cli commands better --- admin/__main__.py | 6 +++--- tipbot/wownero.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/__main__.py b/admin/__main__.py index 6094b77..df25f94 100644 --- a/admin/__main__.py +++ b/admin/__main__.py @@ -17,7 +17,7 @@ def get_users(): users = db.User.select() wallet = wownero.Wallet() for u in users: - click.echo(f'{u.telegram_user} ({u.telegram_id}) - wallet {u.account_index}') + click.echo(f'{u.telegram_user} ({u.telegram_id}) - wallet {u.account_index} ({u.address[0:12]})') @click.command() @click.argument('account_index') @@ -30,8 +30,8 @@ def get_balances(): wallet = wownero.Wallet() accounts = wallet.accounts() for acc in accounts: - balances = wallet.balances(account=acc) - click.echo(f'wallet {acc} - {float(balances[0])} locked, {float(balances[1])} unlocked') + balances = wallet.balances(account=acc[0]) + click.echo(f'wallet {acc[0]} ({acc[1][0:12]}) - {float(balances[0])} locked, {float(balances[1])} unlocked') @click.command() def generate_bot_help(): diff --git a/tipbot/wownero.py b/tipbot/wownero.py index acb49e5..b95161f 100644 --- a/tipbot/wownero.py +++ b/tipbot/wownero.py @@ -47,7 +47,7 @@ class Wallet(object): def accounts(self): _accounts = self.make_wallet_rpc('get_accounts') - return [i['account_index'] for i in _accounts['subaddress_accounts']] + return [(i['account_index'], i['base_address']) for i in _accounts['subaddress_accounts']] def new_account(self, label=None): _account = self.make_wallet_rpc('create_account', {'label': label})