diff --git a/bittensor_cli/src/bittensor/async_substrate_interface.py b/bittensor_cli/src/bittensor/async_substrate_interface.py index 0f4dd0d43..0c40830d6 100644 --- a/bittensor_cli/src/bittensor/async_substrate_interface.py +++ b/bittensor_cli/src/bittensor/async_substrate_interface.py @@ -682,9 +682,9 @@ async def shutdown(self): try: self._receiving_task.cancel() await self._receiving_task + await self.ws.close() except (AttributeError, asyncio.CancelledError): pass - await self.ws.close() self.ws = None self._initialized = False self._receiving_task = None diff --git a/bittensor_cli/src/bittensor/extrinsics/registration.py b/bittensor_cli/src/bittensor/extrinsics/registration.py index 5354ac520..6373824f9 100644 --- a/bittensor_cli/src/bittensor/extrinsics/registration.py +++ b/bittensor_cli/src/bittensor/extrinsics/registration.py @@ -1630,6 +1630,7 @@ async def swap_hotkey_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False if prompt: diff --git a/bittensor_cli/src/bittensor/extrinsics/root.py b/bittensor_cli/src/bittensor/extrinsics/root.py index fcbf7d0c1..295ee640b 100644 --- a/bittensor_cli/src/bittensor/extrinsics/root.py +++ b/bittensor_cli/src/bittensor/extrinsics/root.py @@ -309,6 +309,7 @@ async def root_register_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False print_verbose(f"Checking if hotkey ({wallet.hotkey_str}) is registered on root") @@ -429,6 +430,7 @@ async def _do_set_weights(): try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False # First convert types. diff --git a/bittensor_cli/src/bittensor/extrinsics/transfer.py b/bittensor_cli/src/bittensor/extrinsics/transfer.py index 8ae37e9b6..620c20d76 100644 --- a/bittensor_cli/src/bittensor/extrinsics/transfer.py +++ b/bittensor_cli/src/bittensor/extrinsics/transfer.py @@ -111,6 +111,7 @@ async def do_transfer() -> tuple[bool, str, str]: try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False # Check balance. diff --git a/bittensor_cli/src/commands/root.py b/bittensor_cli/src/commands/root.py index 9a19c7361..2401eb002 100644 --- a/bittensor_cli/src/commands/root.py +++ b/bittensor_cli/src/commands/root.py @@ -283,6 +283,7 @@ async def burned_register_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False with console.status( @@ -539,6 +540,7 @@ async def get_stake_for_coldkey_and_hotkey( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False print_verbose("Checking if hotkey is a delegate") @@ -1100,6 +1102,7 @@ async def senate_vote( wallet.unlock_hotkey() wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False console.print(f"Fetching proposals in [dark_orange]network: {subtensor.network}") @@ -1323,6 +1326,7 @@ async def _do_set_take() -> bool: wallet.unlock_hotkey() wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False result_ = await _do_set_take() @@ -1724,6 +1728,7 @@ async def nominate(wallet: Wallet, subtensor: SubtensorInterface, prompt: bool): wallet.unlock_hotkey() wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False print_verbose(f"Checking hotkey ({wallet.hotkey_str}) is a delegate") diff --git a/bittensor_cli/src/commands/stake/stake.py b/bittensor_cli/src/commands/stake/stake.py index 0f48d6195..819f02cca 100644 --- a/bittensor_cli/src/commands/stake/stake.py +++ b/bittensor_cli/src/commands/stake/stake.py @@ -106,6 +106,7 @@ async def add_stake_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False # Default to wallet's own hotkey if the value is not passed. @@ -312,6 +313,7 @@ async def add_stake_multiple_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False with console.status( @@ -493,6 +495,7 @@ async def unstake_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False if hotkey_ss58 is None: @@ -663,6 +666,7 @@ async def unstake_multiple_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False with console.status( diff --git a/bittensor_cli/src/commands/subnets.py b/bittensor_cli/src/commands/subnets.py index 122fec6ae..3e9349827 100644 --- a/bittensor_cli/src/commands/subnets.py +++ b/bittensor_cli/src/commands/subnets.py @@ -103,6 +103,7 @@ async def _find_event_attributes_in_extrinsic_receipt( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False with console.status(":satellite: Registering subnet...", spinner="earth"): diff --git a/bittensor_cli/src/commands/sudo.py b/bittensor_cli/src/commands/sudo.py index 26cdab5f0..6ebbb0eca 100644 --- a/bittensor_cli/src/commands/sudo.py +++ b/bittensor_cli/src/commands/sudo.py @@ -104,6 +104,7 @@ async def set_hyperparameter_extrinsic( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False extrinsic = HYPERPARAMS.get(parameter) diff --git a/bittensor_cli/src/commands/wallets.py b/bittensor_cli/src/commands/wallets.py index a1dd22623..3faefd23c 100644 --- a/bittensor_cli/src/commands/wallets.py +++ b/bittensor_cli/src/commands/wallets.py @@ -1619,6 +1619,7 @@ async def set_id( try: wallet.unlock_coldkey() except KeyFileError: + err_console.print("Error decrypting coldkey (possibly incorrect password)") return False with console.status(