From faf6217b1cfd4bc8691cd51d3123ff2773e661d6 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Mon, 16 Jun 2025 14:45:58 -0700 Subject: [PATCH 1/2] update netuid in call_params --- bittensor_cli/src/bittensor/extrinsics/registration.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bittensor_cli/src/bittensor/extrinsics/registration.py b/bittensor_cli/src/bittensor/extrinsics/registration.py index 1e3328964..527fedcc7 100644 --- a/bittensor_cli/src/bittensor/extrinsics/registration.py +++ b/bittensor_cli/src/bittensor/extrinsics/registration.py @@ -1820,9 +1820,8 @@ async def swap_hotkey_extrinsic( call_params = { "hotkey": wallet.hotkey.ss58_address, "new_hotkey": new_wallet.hotkey.ss58_address, + "netuid": netuid, } - if netuid is not None: - call_params["netuid"] = netuid call = await subtensor.substrate.compose_call( call_module="SubtensorModule", From 5f401aa157bd616f754416a784fa2b6a093b2227 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Mon, 16 Jun 2025 14:55:08 -0700 Subject: [PATCH 2/2] improve wallet info in swaps --- .../src/bittensor/extrinsics/registration.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bittensor_cli/src/bittensor/extrinsics/registration.py b/bittensor_cli/src/bittensor/extrinsics/registration.py index 527fedcc7..8bbc8064f 100644 --- a/bittensor_cli/src/bittensor/extrinsics/registration.py +++ b/bittensor_cli/src/bittensor/extrinsics/registration.py @@ -1798,23 +1798,23 @@ async def swap_hotkey_extrinsic( if netuid is not None: confirm_message = ( f"Do you want to swap [dark_orange]{wallet.name}[/dark_orange] hotkey \n\t" - f"[dark_orange]{wallet.hotkey.ss58_address}[/dark_orange] with hotkey \n\t" - f"[dark_orange]{new_wallet.hotkey.ss58_address}[/dark_orange] on subnet {netuid}\n" + f"[dark_orange]{wallet.hotkey.ss58_address} ({wallet.hotkey_str})[/dark_orange] with hotkey \n\t" + f"[dark_orange]{new_wallet.hotkey.ss58_address} ({new_wallet.hotkey_str})[/dark_orange] on subnet {netuid}\n" "This operation will cost [bold cyan]1 TAO (recycled)[/bold cyan]" ) else: confirm_message = ( f"Do you want to swap [dark_orange]{wallet.name}[/dark_orange] hotkey \n\t" - f"[dark_orange]{wallet.hotkey.ss58_address}[/dark_orange] with hotkey \n\t" - f"[dark_orange]{new_wallet.hotkey.ss58_address}[/dark_orange] on all subnets\n" + f"[dark_orange]{wallet.hotkey.ss58_address} ({wallet.hotkey_str})[/dark_orange] with hotkey \n\t" + f"[dark_orange]{new_wallet.hotkey.ss58_address} ({new_wallet.hotkey_str})[/dark_orange] on all subnets\n" "This operation will cost [bold cyan]1 TAO (recycled)[/bold cyan]" ) if not Confirm.ask(confirm_message): return False print_verbose( - f"Swapping {wallet.name}'s hotkey ({wallet.hotkey.ss58_address}) with " - f"{new_wallet.name}'s hotkey ({new_wallet.hotkey.ss58_address})" + f"Swapping {wallet.name}'s hotkey ({wallet.hotkey.ss58_address} - {wallet.hotkey_str}) with " + f"{new_wallet.name}'s hotkey ({new_wallet.hotkey.ss58_address} - {new_wallet.hotkey_str})" ) with console.status(":satellite: Swapping hotkeys...", spinner="aesthetic"): call_params = { @@ -1832,7 +1832,7 @@ async def swap_hotkey_extrinsic( if success: console.print( - f"Hotkey {wallet.hotkey} swapped for new hotkey: {new_wallet.hotkey}" + f"Hotkey {wallet.hotkey.ss58_address} ({wallet.hotkey_str}) swapped for new hotkey: {new_wallet.hotkey.ss58_address} ({new_wallet.hotkey_str})" ) return True else: