Skip to content

Conversation

kudroma1
Copy link

Bug

There are no stakes in metagraph.S that is created for MockSubtensor.
They are absent even if we add neurons using force_register_neuron() method.

subtensor_mock = MockSubtensor()
subtensor_mock.setup()
subtensor_mock.create_subnet(netuid)

for wallet in wallets:
    # It is important to use float number for stake and balance.
    # int is considered as rao. It is divided internally by 1e9.
    subtensor_mock.force_register_neuron(
        netuid=netuid,
        hotkey=wallet.hotkey.ss58_address,
        coldkey=wallet.coldkey.ss58_address,
        stake=bt.Balance(10000.0),
        balance=bt.Balance(10000.0),
    )

metagraph = bt.Metagraph(netuid=netuid, network=subtensor_mock.network, sync=False)
metagraph.sync(subtensor=subtensor_mock)
print(len(metagraph.S))

Description of the Change

Imlemeted methods query_runtime_api() to get subnet state and get_metagraph_info().

Verification Process

I ran tests locally to see that there are no regressions.

Branch Acknowledgement

[ ] I am acknowledging that I am opening this branch against staging

@kudroma1 kudroma1 changed the base branch from master to staging August 29, 2025 10:50
@basfroman
Copy link
Collaborator

fix all checkers and tests pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants