Skip to content

Commit b6c5876

Browse files
committed
More commands.
1 parent aa70fb3 commit b6c5876

File tree

1 file changed

+6
-4
lines changed
  • bittensor_cli/src/commands/stake

1 file changed

+6
-4
lines changed

bittensor_cli/src/commands/stake/move.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
group_subnets,
1717
get_subnet_name,
1818
unlock_key,
19+
get_hotkey_pub_ss58,
1920
)
2021

2122
if TYPE_CHECKING:
@@ -343,8 +344,9 @@ async def stake_swap_selection(
343344

344345
# Filter stakes for this hotkey
345346
hotkey_stakes = {}
347+
hotkey_ss58 = get_hotkey_pub_ss58(wallet)
346348
for stake in stakes:
347-
if stake.hotkey_ss58 == wallet.hotkey.ss58_address and stake.stake.tao > 0:
349+
if stake.hotkey_ss58 == hotkey_ss58 and stake.stake.tao > 0:
348350
hotkey_stakes[stake.netuid] = {
349351
"stake": stake.stake,
350352
"is_registered": stake.is_registered,
@@ -357,12 +359,12 @@ async def stake_swap_selection(
357359
# Display available stakes
358360
table = Table(
359361
title=f"\n[{COLOR_PALETTE.G.HEADER}]Available Stakes for Hotkey\n[/{COLOR_PALETTE.G.HEADER}]"
360-
f"[{COLOR_PALETTE.G.HK}]{wallet.hotkey_str}: {wallet.hotkey.ss58_address}[/{COLOR_PALETTE.G.HK}]\n",
362+
f"[{COLOR_PALETTE.G.HK}]{wallet.hotkey_str}: {hotkey_ss58}[/{COLOR_PALETTE.G.HK}]\n",
361363
show_edge=False,
362364
header_style="bold white",
363365
border_style="bright_black",
364366
title_justify="center",
365-
width=len(wallet.hotkey.ss58_address) + 20,
367+
width=len(hotkey_ss58) + 20,
366368
)
367369

368370
table.add_column("Index", justify="right", style="cyan")
@@ -817,7 +819,7 @@ async def swap_stake(
817819
Returns:
818820
bool: True if the swap was successful, False otherwise.
819821
"""
820-
hotkey_ss58 = wallet.hotkey.ss58_address
822+
hotkey_ss58 = get_hotkey_pub_ss58(wallet)
821823
if interactive_selection:
822824
try:
823825
selection = await stake_swap_selection(subtensor, wallet)

0 commit comments

Comments
 (0)