File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1503,8 +1503,15 @@ async def get_metagraph_info(
1503
1503
"""
1504
1504
indices = SelectiveMetagraphIndex .all_indices ()
1505
1505
1506
- if field_indices and isinstance (field_indices , list ):
1507
- indices = [f .value for f in field_indices ]
1506
+ if field_indices :
1507
+ if isinstance (field_indices , list ) and all (
1508
+ isinstance (f , SelectiveMetagraphIndex ) for f in field_indices
1509
+ ):
1510
+ indices = [f .value for f in field_indices ]
1511
+ else :
1512
+ raise ValueError (
1513
+ "`field_indices` must be a list of SelectiveMetagraphIndex items."
1514
+ )
1508
1515
1509
1516
block_hash = await self .determine_block_hash (block , block_hash , reuse_block )
1510
1517
if not block_hash and reuse_block :
Original file line number Diff line number Diff line change @@ -1160,8 +1160,15 @@ def get_metagraph_info(
1160
1160
"""
1161
1161
indices = SelectiveMetagraphIndex .all_indices ()
1162
1162
1163
- if field_indices and isinstance (field_indices , list ):
1164
- indices = [f .value for f in field_indices ]
1163
+ if field_indices :
1164
+ if isinstance (field_indices , list ) and all (
1165
+ isinstance (f , SelectiveMetagraphIndex ) for f in field_indices
1166
+ ):
1167
+ indices = [f .value for f in field_indices ]
1168
+ else :
1169
+ raise ValueError (
1170
+ "`field_indices` must be a list of SelectiveMetagraphIndex items."
1171
+ )
1165
1172
1166
1173
block_hash = self .determine_block_hash (block )
1167
1174
query = self .substrate .runtime_call (
You can’t perform that action at this time.
0 commit comments