@@ -622,14 +622,23 @@ async def revoke_children(
622
622
wait_for_inclusion = wait_for_inclusion ,
623
623
wait_for_finalization = wait_for_finalization ,
624
624
)
625
- dict_output [netuid ] = {"success" : success , "error" : message }
625
+ dict_output [netuid ] = {
626
+ "success" : success ,
627
+ "error" : message ,
628
+ "set_block" : None ,
629
+ "completion_block" : None ,
630
+ }
626
631
627
632
# Result
628
633
if success :
629
- if wait_for_finalization and wait_for_inclusion :
630
- await get_children (wallet , subtensor , netuid )
634
+ current_block , completion_block = await get_childkey_completion_block (
635
+ subtensor , netuid
636
+ )
637
+ dict_output [netuid ]["completion_block" ] = completion_block
638
+ dict_output [netuid ]["set_block" ] = current_block
631
639
console .print (
632
- ":white_heavy_check_mark: [green]Revoked children hotkeys.[/green]"
640
+ f":white_heavy_check_mark: Your childkey revocation request for netuid { netuid } has been submitted. "
641
+ f"It will be completed around block { completion_block } . The current block is { current_block } "
633
642
)
634
643
else :
635
644
console .print (
@@ -638,10 +647,10 @@ async def revoke_children(
638
647
else :
639
648
# revoke children from ALL netuids
640
649
netuids = await subtensor .get_all_subnet_netuids ()
641
- for netuid in netuids :
642
- if netuid == 0 : # dont include root network
650
+ for netuid_ in netuids :
651
+ if netuid_ == 0 : # dont include root network
643
652
continue
644
- console .print (f"Revoking children from netuid { netuid } ." )
653
+ console .print (f"Revoking children from netuid { netuid_ } ." )
645
654
success , message = await set_children_extrinsic (
646
655
subtensor = subtensor ,
647
656
wallet = wallet ,
@@ -652,10 +661,23 @@ async def revoke_children(
652
661
wait_for_inclusion = True ,
653
662
wait_for_finalization = False ,
654
663
)
655
- dict_output [netuid ] = {"success" : success , "error" : message }
656
- console .print (
657
- ":white_heavy_check_mark: [green]Sent revoke children command. Finalization may take a few minutes.[/green]"
658
- )
664
+ dict_output [netuid_ ] = {
665
+ "success" : success ,
666
+ "error" : message ,
667
+ "set_block" : None ,
668
+ "completion_block" : None ,
669
+ }
670
+ if success :
671
+ current_block , completion_block = await get_childkey_completion_block (
672
+ subtensor , netuid_
673
+ )
674
+ dict_output [netuid_ ]["completion_block" ] = completion_block
675
+ dict_output [netuid_ ]["set_block" ] = current_block
676
+ console .print (
677
+ f":white_heavy_check_mark: Your childkey revocation request for netuid { netuid_ } has been "
678
+ f"submitted. It will be completed around block { completion_block } . The current block "
679
+ f"is { current_block } "
680
+ )
659
681
if json_output :
660
682
json_console .print (json .dumps (dict_output ))
661
683
0 commit comments