From d49aa8fe3f0a89eacd252d5f480980bf998be6ba Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 5 Sep 2024 11:10:04 -0700 Subject: [PATCH] Fixes wallet fetching default wallets --- bittensor_cli/cli.py | 28 +++++++++++++++------------ bittensor_cli/src/commands/wallets.py | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 88b4cb60..17cff805 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -971,7 +971,9 @@ def wallet_overview( wallet_path = Prompt.ask( "Enter the path of the wallets", default=defaults.wallet.path ) - wallet = self.wallet_ask(wallet_name, wallet_path, wallet_hotkey) + wallet = self.wallet_ask( + wallet_name, wallet_path, wallet_hotkey, validate=False + ) return self._run_command( wallets.overview( wallet, @@ -1128,7 +1130,9 @@ def wallet_inspect( wallet_path = Prompt.ask( "Enter the path of the wallets", default=defaults.wallet.path ) - wallet = self.wallet_ask(wallet_name, wallet_path, wallet_hotkey) + wallet = self.wallet_ask( + wallet_name, wallet_path, wallet_hotkey, validate=False + ) self.initialize_chain(network, chain) return self._run_command( wallets.inspect( @@ -1515,10 +1519,10 @@ def wallet_balance( # Example usages: - - To display the balance of a single wallet, use the command with the `--wallet.name` argument to specify + - To display the balance of a single wallet, use the command with the `--wallet-name` argument to specify the wallet name: - [green]$[/green] btcli w balance --wallet.name WALLET + [green]$[/green] btcli w balance --wallet-name WALLET [green]$[/green] btcli w balance @@ -1532,7 +1536,9 @@ def wallet_balance( "Enter the path of the wallets", default=defaults.wallet.path ) subtensor = self.initialize_chain(network, chain) - wallet = self.wallet_ask(wallet_name, wallet_path, wallet_hotkey) + wallet = self.wallet_ask( + wallet_name, wallet_path, wallet_hotkey, validate=False + ) return self._run_command( wallets.wallet_balance(wallet, subtensor, all_balances) ) @@ -1750,7 +1756,7 @@ def wallet_sign( [green]$[/green] btcli wallet sign --wallet-name default --message '{"something": "here", "timestamp": 1719908486}' - [green]$[/green] btcli wallet sign --wallet.name default --wallet-hotkey hotkey --message + [green]$[/green] btcli wallet sign --wallet-name default --wallet-hotkey hotkey --message '{"something": "here", "timestamp": 1719908486}' [italic]Note[/italic]: When using `btcli`, `w` is used interchangeably with `wallet`. You may use either based @@ -2148,7 +2154,7 @@ def root_set_take( # Example usage: - [green]$[/green] btcli root set_take --wallet.name my_wallet --wallet.hotkey my_hotkey + [green]$[/green] btcli root set_take --wallet-name my_wallet --wallet-hotkey my_hotkey [italic]Note[/italic]: This function can be used to update the takes individually for every subnet """ @@ -2438,7 +2444,7 @@ def root_list_delegates( [green]$[/green] btcli root list_delegates - [green]$[/green] btcli root list_delegates --wallet.name my_wallet + [green]$[/green] btcli root list_delegates --wallet-name my_wallet [green]$[/green] btcli root list_delegates --subtensor.network finney # can also be `test` or `local` @@ -2488,7 +2494,7 @@ def root_nominate( [green]$[/green] btcli root nominate - [green]$[/green] btcli root nominate --wallet.name my_wallet --wallet.hotkey my_hotkey + [green]$[/green] btcli root nominate --wallet-name my_wallet --wallet-hotkey my_hotkey [italic]Note[/italic]: This function is intended to be used as a CLI command. It prints the outcome directly to the console and does not return any value. It should not be called programmatically in user code due to its interactive nature and @@ -2668,9 +2674,7 @@ def stake_add( if not wallet_hotkey and not all_hotkeys and not include_hotkeys: _hotkey_str = typer.style("hotkey", fg="red") - hotkey = typer.prompt( - f"Enter {_hotkey_str} name to stake or ss58_address" - ) + hotkey = typer.prompt(f"Enter {_hotkey_str} name to stake or ss58_address") if not is_valid_ss58_address(hotkey): wallet_hotkey = hotkey wallet = self.wallet_ask( diff --git a/bittensor_cli/src/commands/wallets.py b/bittensor_cli/src/commands/wallets.py index cfae96e2..cc000f28 100644 --- a/bittensor_cli/src/commands/wallets.py +++ b/bittensor_cli/src/commands/wallets.py @@ -1225,7 +1225,7 @@ def neuron_row_maker( else: wallets = [wallet] all_hotkeys = get_hotkey_wallets_for_wallet(wallet) - with console.status("synchronising with chain"): + with console.status("Synchronising with chain...", spinner="aesthetic"): block_hash = await subtensor.substrate.get_chain_head() await subtensor.substrate.init_runtime(block_hash=block_hash) all_netuids = await subtensor.filter_netuids_by_registered_hotkeys(