Skip to content

Fixes identity lookup #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions bittensor_cli/src/commands/stake/stake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,14 +1190,15 @@ async def unstake_selection(

hotkeys_info = []
for idx, (hotkey_ss58, netuid_stakes) in enumerate(hotkey_stakes.items()):
identity = identities["hotkeys"].get(hotkey_ss58) or old_identities.get(
hotkey_ss58
)
hotkey_name = "~"
if identity:
hotkey_name = identity.get("identity", {}).get("name", "") or identity.get(
"display", "~"
)
if hk_identity := identities["hotkeys"].get(hotkey_ss58):
hotkey_name = hk_identity.get("identity", {}).get(
"name", ""
) or hk_identity.get("display", "~")
elif old_identity := old_identities.get(hotkey_ss58):
hotkey_name = old_identity.display
else:
hotkey_name = "~"

# TODO: Add wallet ids here.

hotkeys_info.append(
Expand Down Expand Up @@ -1461,15 +1462,16 @@ async def _unstake_all(
total_received_value += received_amount

# Get hotkey identity
identity = ck_hk_identities["hotkeys"].get(
stake.hotkey_ss58
) or old_identities.get(stake.hotkey_ss58)
hotkey_display = stake.hotkey_ss58
if identity:
hotkey_name = identity.get("identity", {}).get(
if hk_identity := ck_hk_identities["hotkeys"].get(stake.hotkey_ss58):
hotkey_name = hk_identity.get("identity", {}).get(
"name", ""
) or identity.get("display", "~")
) or hk_identity.get("display", "~")
hotkey_display = f"{hotkey_name}"
elif old_identity := old_identities.get(stake.hotkey_ss58):
hotkey_name = old_identity.display
hotkey_display = f"{hotkey_name}"
else:
hotkey_display = stake.hotkey_ss58

if dynamic_info.is_dynamic:
slippage_pct_float = (
Expand Down