Skip to content
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

update stake_info fields that caused exception in dereg stake calc #1712

Merged
merged 3 commits into from
Feb 21, 2024
Merged
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
12 changes: 9 additions & 3 deletions bittensor/commands/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,14 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
de_registered_neurons.append(de_registered_neuron)

# Add this hotkey to the wallets dict
wallet_ = bittensor.Wallet(
wallet_ = bittensor.wallet(
name=wallet,
)
wallet_.hotkey = hotkey_addr
wallet_.hotkey_ss58 = hotkey_addr
wallet.hotkey_str = hotkey_addr[:5] # Max length of 5 characters
# Indicates a hotkey not on local machine but exists in stake_info obj on-chain
if hotkey_coldkey_to_hotkey_wallet.get(hotkey_addr) == None:
hotkey_coldkey_to_hotkey_wallet[hotkey_addr] = {}
hotkey_coldkey_to_hotkey_wallet[hotkey_addr][
coldkey_wallet.coldkeypub.ss58_address
] = wallet_
Expand Down Expand Up @@ -632,7 +635,10 @@ def _filter_stake_info(stake_info: "bittensor.StakeInfo") -> bool:

all_staked_hotkeys = filter(_filter_stake_info, all_stake_info_for_coldkey)
result = [
(stake_info.hotkey, stake_info.stake)
(
stake_info.hotkey_ss58,
stake_info.stake.tao,
) # stake is a Balance object
for stake_info in all_staked_hotkeys
]

Expand Down