Skip to content

get_stake_for_coldkey does not work for blocks before dTao upgrade #158

@RD4Fun

Description

@RD4Fun

Describe the bug

The subtensorAPI synchronous function get_stake_for_coldkey does not work for blocks before dTao implemented
ie less than 4920350

To Reproduce

run the following code

from bittensor import SubtensorApi
sub = SubtensorApi(network='archive',legacy_methods=True, async_subtensor=False)
# works
print(sub.get_stake_info_for_coldkey('5CQ6dMW8JZhKCZX9kWsZRqa3kZRKmNHxbPPVFEt6FgyvGv2G',4943592))
# fails
print(sub.get_stake_info_for_coldkey('5CQ6dMW8JZhKCZX9kWsZRqa3kZRKmNHxbPPVFEt6FgyvGv2G',4670227))

Expected behavior

return the same StakeInfo type as after dTao with None in unused fields and netuid = 0

Screenshots

Image

Environment

Ubuntu 24.04.1 LTS bittensor 9.8.3 cli 9.8.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions