Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4903,7 +4903,7 @@ async def get_staking_hotkeys(
params=[coldkey_ss58],
block_hash=block_hash,
)
return result or []
return result.value or []

async def get_start_call_delay(
self,
Expand Down
7 changes: 7 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[mypy]
ignore_missing_imports = True
ignore_errors = True
follow_imports_for_stubs = True

[mypy-numpy.*]
follow_imports = skip

[mypy-numpy]
follow_imports = skip

[mypy-*.axon.*]
ignore_errors = False
Expand Down
20 changes: 20 additions & 0 deletions tests/unit_tests/test_async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,26 @@ async def test_get_subnet_burn_cost(subtensor, mocker):
)


@pytest.mark.asyncio
async def test_get_staking_hotkeys_returns_value(subtensor, mocker):
"""get_staking_hotkeys must return the decoded list (``.value``), not the raw ScaleType."""
# Preps - mimic a ScaleType whose ``.value`` is the list of hotkey ss58 addresses
fake_hotkeys = ["5GrwvaEF...", "5FHneW46..."]
mocked_substrate_query = mocker.AsyncMock(
autospec=async_subtensor.AsyncSubstrateInterface.query,
return_value=mocker.Mock(value=fake_hotkeys),
)
subtensor.substrate.query = mocked_substrate_query

# Call
result = await subtensor.get_staking_hotkeys(
coldkey_ss58="5DDjk9T2...", block_hash=None
)

# Assert - the decoded list is returned, not the wrapper object
assert result == fake_hotkeys


@pytest.mark.asyncio
async def test_get_total_subnets(subtensor, mocker):
"""Tests get_total_subnets method."""
Expand Down