Skip to content

Commit

Permalink
found a solution that is testable and works in manual testing
Browse files Browse the repository at this point in the history
  • Loading branch information
niljub committed Aug 20, 2024
1 parent ff85620 commit a9cb336
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bittensor/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4254,8 +4254,13 @@ def get_subnets(self, block: Optional[int] = None) -> List[int]:
"""
result = self.query_map_subtensor("NetworksAdded", block)
subnets = []

for data in result:
subnets.append(data[0])
continue
# Check if the 'records' attribute exists and is not None
if hasattr(result, "records") and result.records:
subnets = [subnet[0].value for subnet in result.records]

return subnets

def get_all_subnets_info(self, block: Optional[int] = None) -> List[SubnetInfo]:
Expand Down

0 comments on commit a9cb336

Please sign in to comment.