@@ -752,6 +752,38 @@ def get_hyperparameter(
752
752
753
753
return getattr (result , "value" , result )
754
754
755
+ def get_parents (
756
+ self , hotkey : str , netuid : int , block : Optional [int ] = None
757
+ ) -> list [tuple [float , str ]]:
758
+ """
759
+ This method retrieves the parent of a given hotkey and netuid. It queries the SubtensorModule's ParentKeys
760
+ storage function to get the children and formats them before returning as a tuple.
761
+
762
+ Arguments:
763
+ hotkey: The child hotkey SS58.
764
+ netuid: The netuid.
765
+ block: The block number for which the children are to be retrieved.
766
+
767
+ Returns:
768
+ A list of formatted parents [(proportion, parent)]
769
+ """
770
+ parents = self .substrate .query (
771
+ module = "SubtensorModule" ,
772
+ storage_function = "ParentKeys" ,
773
+ params = [hotkey , netuid ],
774
+ block_hash = self .determine_block_hash (block ),
775
+ )
776
+ if parents :
777
+ formatted_parents = []
778
+ for proportion , parent in parents .value :
779
+ # Convert U64 to int
780
+ formatted_child = decode_account_id (parent [0 ])
781
+ normalized_proportion = u64_normalized_float (proportion )
782
+ formatted_parents .append ((normalized_proportion , formatted_child ))
783
+ return formatted_parents
784
+
785
+ return []
786
+
755
787
def get_children (
756
788
self , hotkey : str , netuid : int , block : Optional [int ] = None
757
789
) -> tuple [bool , list [tuple [float , str ]], str ]:
@@ -1871,7 +1903,7 @@ def get_transfer_fee(self, wallet: "Wallet", dest: str, value: Balance) -> Balan
1871
1903
value = check_and_convert_to_balance (value )
1872
1904
call = self .substrate .compose_call (
1873
1905
call_module = "Balances" ,
1874
- call_function = "transfer_allow_death " ,
1906
+ call_function = "transfer_keep_alive " ,
1875
1907
call_params = {"dest" : dest , "value" : value .rao },
1876
1908
)
1877
1909
0 commit comments