Skip to content

Commit 0bc61a5

Browse files
author
Roman
committed
add netuid to result for always
1 parent 46315e2 commit 0bc61a5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bittensor/core/async_subtensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,13 +1501,13 @@ async def get_metagraph_info(
15011501
field_indices=[SelectiveMetagraphIndex.Name, SelectiveMetagraphIndex.OwnerHotkeys]
15021502
)
15031503
"""
1504-
indices = SelectiveMetagraphIndex.all_indices()
1504+
indexes = SelectiveMetagraphIndex.all_indices()
15051505

15061506
if field_indices:
15071507
if isinstance(field_indices, list) and all(
15081508
isinstance(f, SelectiveMetagraphIndex) for f in field_indices
15091509
):
1510-
indices = [f.value for f in field_indices]
1510+
indexes = [f.value for f in field_indices]
15111511
else:
15121512
raise ValueError(
15131513
"`field_indices` must be a list of SelectiveMetagraphIndex items."
@@ -1520,7 +1520,7 @@ async def get_metagraph_info(
15201520
query = await self.substrate.runtime_call(
15211521
"SubnetInfoRuntimeApi",
15221522
"get_selective_metagraph",
1523-
params=[netuid, indices],
1523+
params=[netuid, indexes if 0 in indexes else [0] + indexes],
15241524
block_hash=block_hash,
15251525
)
15261526
if query.value is None:

bittensor/core/subtensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,13 +1158,13 @@ def get_metagraph_info(
11581158
field_indices=[SelectiveMetagraphIndex.Name, SelectiveMetagraphIndex.OwnerHotkeys]
11591159
)
11601160
"""
1161-
indices = SelectiveMetagraphIndex.all_indices()
1161+
indexes = SelectiveMetagraphIndex.all_indices()
11621162

11631163
if field_indices:
11641164
if isinstance(field_indices, list) and all(
11651165
isinstance(f, SelectiveMetagraphIndex) for f in field_indices
11661166
):
1167-
indices = [f.value for f in field_indices]
1167+
indexes = [f.value for f in field_indices]
11681168
else:
11691169
raise ValueError(
11701170
"`field_indices` must be a list of SelectiveMetagraphIndex items."
@@ -1174,7 +1174,7 @@ def get_metagraph_info(
11741174
query = self.substrate.runtime_call(
11751175
"SubnetInfoRuntimeApi",
11761176
"get_selective_metagraph",
1177-
params=[netuid, indices],
1177+
params=[netuid, indexes if 0 in indexes else [0] + indexes],
11781178
block_hash=block_hash,
11791179
)
11801180
if query.value is None:

0 commit comments

Comments
 (0)