Skip to content

Commit

Permalink
Merge pull request #1712 from opentensor/wallet/overview-fix-stake-in…
Browse files Browse the repository at this point in the history
…fo-fields/phil

update stake_info fields that caused exception in dereg stake calc
  • Loading branch information
ifrit98 authored Feb 21, 2024
2 parents eee0aa4 + 4f8d074 commit b1b10bd
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit b1b10bd

Please sign in to comment.