Skip to content

Commit df6564b

Browse files
author
opendansor
committed
update
1 parent a18fcd5 commit df6564b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

bittensor/utils/subtensor.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import json
2323
import logging
2424
import os
25-
from typing import Dict, Optional, Union, Any
25+
from typing import Dict, Optional, Union, Any, List, Tuple
2626

2727
from substrateinterface.base import SubstrateInterface
2828

@@ -139,14 +139,22 @@ def get_subtensor_errors(
139139
return cached_errors_map.get("errors", {})
140140

141141

142-
def format_parent(proportion, parent):
142+
def format_parent(proportion, parent) -> Tuple[str, str]:
143+
"""
144+
Formats raw parent data into a list of tuples.
145+
Args:
146+
parent: The raw parent data.
147+
proportion: proportion of parent data.
148+
Returns:
149+
list: List of (proportion, child_address) tuples.
150+
"""
143151
int_proportion = (
144152
proportion.value if hasattr(proportion, "value") else int(proportion)
145153
)
146154
return int_proportion, parent.value
147155

148156

149-
def format_children(children):
157+
def format_children(children: str) -> List[Tuple[str, str]]:
150158
"""
151159
Formats raw children data into a list of tuples.
152160
Args:

0 commit comments

Comments
 (0)