Skip to content

Commit 086dda5

Browse files
committed
Fixed overview message descripancy
1 parent 63917ab commit 086dda5

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

bittensor_cli/src/commands/wallets.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,13 @@ async def overview(
656656
neurons
657657
)
658658

659+
has_alerts = False
659660
alerts_table = Table(show_header=True, header_style="bold magenta")
660661
alerts_table.add_column("🥩 alert!")
662+
alerts_table.add_row(
663+
"[bold]Detected the following stake(s) associated with coldkey(s) that are not linked to any local hotkeys:[/bold]"
664+
)
665+
alerts_table.add_row("")
661666

662667
coldkeys_to_check = []
663668
ck_stakes = await subtensor.get_total_stake_for_coldkey(
@@ -680,12 +685,23 @@ async def overview(
680685
if difference == 0:
681686
continue # We have all our stake registered.
682687

688+
has_alerts = True
683689
coldkeys_to_check.append(coldkey_wallet)
684690
alerts_table.add_row(
685-
"Found [light_goldenrod2]{}[/light_goldenrod2] stake with coldkey [bright_magenta]{}[/bright_magenta] that is not registered.".format(
686-
abs(difference), coldkey_wallet.coldkeypub.ss58_address
691+
"[light_goldenrod2]{}[/light_goldenrod2] stake associated with coldkey [bright_magenta]{}[/bright_magenta] (ss58: [bright_magenta]{}[/bright_magenta])".format(
692+
abs(difference),
693+
coldkey_wallet.name,
694+
coldkey_wallet.coldkeypub.ss58_address,
687695
)
688696
)
697+
if has_alerts:
698+
alerts_table.add_row("")
699+
alerts_table.add_row(
700+
"[bold yellow]Note:[/bold yellow] This stake might be delegated, staked to another user's hotkey, or associated with a hotkey not present in your wallet."
701+
)
702+
alerts_table.add_row(
703+
"You can find out more by executing `[bold]btcli wallet inspect[/bold]` command."
704+
)
689705

690706
if coldkeys_to_check:
691707
# We have some stake that is not with a registered hotkey.
@@ -739,7 +755,7 @@ async def overview(
739755
grid = Table.grid(pad_edge=True)
740756

741757
# If there are any alerts, add them to the grid
742-
if len(alerts_table.rows) > 0:
758+
if has_alerts:
743759
grid.add_row(alerts_table)
744760

745761
# Add title

0 commit comments

Comments
 (0)