@@ -609,7 +609,7 @@ def run(cli: "bittensor.cli"):
609
609
@staticmethod
610
610
def _run (cli : "bittensor.cli" , subtensor : "bittensor.subtensor" ):
611
611
wallet = bittensor .wallet (config = cli .config )
612
-
612
+
613
613
# Get values if not set.
614
614
if not cli .config .is_set ("netuid" ):
615
615
cli .config .netuid = int (Prompt .ask ("Enter netuid" ))
@@ -618,7 +618,12 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
618
618
cli .config .hotkey = Prompt .ask ("Enter parent hotkey (ss58)" )
619
619
620
620
# display children
621
- GetChildrenCommand .retrieve_children (subtensor = subtensor , hotkey = cli .config .hotkey , netuid = cli .config .netuid , render_table = True )
621
+ GetChildrenCommand .retrieve_children (
622
+ subtensor = subtensor ,
623
+ hotkey = cli .config .hotkey ,
624
+ netuid = cli .config .netuid ,
625
+ render_table = True ,
626
+ )
622
627
623
628
if not cli .config .is_set ("children" ):
624
629
cli .config .children = Prompt .ask (
@@ -663,8 +668,12 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
663
668
664
669
# Result
665
670
if success :
666
- GetChildrenCommand .retrieve_children (subtensor = subtensor , hotkey = cli .config .hotkey ,
667
- netuid = cli .config .netuid , render_table = True )
671
+ GetChildrenCommand .retrieve_children (
672
+ subtensor = subtensor ,
673
+ hotkey = cli .config .hotkey ,
674
+ netuid = cli .config .netuid ,
675
+ render_table = True ,
676
+ )
668
677
console .print (
669
678
":white_heavy_check_mark: [green]Set children hotkeys.[/green]"
670
679
)
@@ -780,9 +789,11 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
780
789
GetChildrenCommand .render_table (subtensor , hotkey , children , netuid , True )
781
790
782
791
return children
783
-
792
+
784
793
@staticmethod
785
- def retrieve_children (subtensor : "bittensor.subtensor" , hotkey : str , netuid : int , render_table : bool ):
794
+ def retrieve_children (
795
+ subtensor : "bittensor.subtensor" , hotkey : str , netuid : int , render_table : bool
796
+ ):
786
797
children = subtensor .get_children (hotkey , netuid )
787
798
if render_table :
788
799
GetChildrenCommand .render_table (subtensor , hotkey , children , netuid , False )
@@ -834,15 +845,19 @@ def render_table(
834
845
835
846
if not children :
836
847
console .print (table )
837
- console .print (f"There are currently no child hotkeys on subnet { netuid } with ParentHotKey { hotkey } ." )
848
+ console .print (
849
+ f"There are currently no child hotkeys on subnet { netuid } with ParentHotKey { hotkey } ."
850
+ )
838
851
if prompt :
839
852
command = f"btcli stake set_children --children <child_hotkey> --hotkey <parent_hotkey> --netuid { netuid } --proportion <float>"
840
- console .print (f"To add a child hotkey you can run the command: [white]{ command } [/white]" )
853
+ console .print (
854
+ f"To add a child hotkey you can run the command: [white]{ command } [/white]"
855
+ )
841
856
return
842
857
843
858
console .print ("ParentHotKey:" , style = "cyan" , no_wrap = True )
844
859
console .print (hotkey )
845
-
860
+
846
861
# calculate totals
847
862
total_proportion = 0
848
863
total_stake = 0
@@ -867,7 +882,9 @@ def render_table(
867
882
868
883
# add the children info to the table
869
884
for i , (proportion , hotkey , stake ) in enumerate (children_info , 1 ):
870
- proportion_str = Text (str (proportion ), style = "red" if proportion == 0 else "" )
885
+ proportion_str = Text (
886
+ str (proportion ), style = "red" if proportion == 0 else ""
887
+ )
871
888
hotkey = Text (hotkey , style = "red" if proportion == 0 else "" )
872
889
table .add_row (
873
890
str (i ),
@@ -879,4 +896,3 @@ def render_table(
879
896
# add totals row
880
897
table .add_row ("" , "Total" , str (total_proportion ), str (total_stake ), "" )
881
898
console .print (table )
882
-
0 commit comments