@@ -524,9 +524,11 @@ async def get_neuron_for_pubkey_and_subnet():
524
524
if prompt :
525
525
if not Confirm .ask (
526
526
f"Continue Registration?\n "
527
- f" hotkey [{ COLOR_PALETTE ['GENERAL' ]['HOTKEY' ]} ]({ wallet .hotkey_str } )[/{ COLOR_PALETTE ['GENERAL' ]['HOTKEY' ]} ]:\t [{ COLOR_PALETTE ['GENERAL' ]['HOTKEY' ]} ]{ wallet .hotkey .ss58_address } [/{ COLOR_PALETTE ['GENERAL' ]['HOTKEY' ]} ]\n "
528
- f" coldkey [{ COLOR_PALETTE ['GENERAL' ]['COLDKEY' ]} ]({ wallet .name } )[/{ COLOR_PALETTE ['GENERAL' ]['COLDKEY' ]} ]:\t [{ COLOR_PALETTE ['GENERAL' ]['COLDKEY' ]} ]{ wallet .coldkeypub .ss58_address } [/{ COLOR_PALETTE ['GENERAL' ]['COLDKEY' ]} ]\n "
529
- f" network:\t \t [{ COLOR_PALETTE ['GENERAL' ]['LINKS' ]} ]{ subtensor .network } [/{ COLOR_PALETTE ['GENERAL' ]['LINKS' ]} ]\n "
527
+ f" hotkey [{ COLOR_PALETTE .G .HK } ]({ wallet .hotkey_str } )[/{ COLOR_PALETTE .G .HK } ]:"
528
+ f"\t [{ COLOR_PALETTE .G .HK } ]{ wallet .hotkey .ss58_address } [/{ COLOR_PALETTE .G .HK } ]\n "
529
+ f" coldkey [{ COLOR_PALETTE .G .CK } ]({ wallet .name } )[/{ COLOR_PALETTE .G .CK } ]:"
530
+ f"\t [{ COLOR_PALETTE .G .CK } ]{ wallet .coldkeypub .ss58_address } [/{ COLOR_PALETTE .G .CK } ]\n "
531
+ f" network:\t \t [{ COLOR_PALETTE .G .LINKS } ]{ subtensor .network } [/{ COLOR_PALETTE .G .LINKS } ]\n "
530
532
):
531
533
return False
532
534
@@ -611,7 +613,6 @@ async def get_neuron_for_pubkey_and_subnet():
611
613
if not wait_for_finalization and not wait_for_inclusion :
612
614
success , err_msg = True , ""
613
615
else :
614
- await response .process_events ()
615
616
success = await response .is_success
616
617
if not success :
617
618
success , err_msg = (
@@ -678,7 +679,7 @@ async def burned_register_extrinsic(
678
679
wait_for_finalization : bool = True ,
679
680
era : Optional [int ] = None ,
680
681
prompt : bool = False ,
681
- ) -> bool :
682
+ ) -> tuple [ bool , str ] :
682
683
"""Registers the wallet to chain by recycling TAO.
683
684
684
685
:param subtensor: The SubtensorInterface object to use for the call, initialized
@@ -689,10 +690,11 @@ async def burned_register_extrinsic(
689
690
`False` if the extrinsic fails to enter the block within the timeout.
690
691
:param wait_for_finalization: If set, waits for the extrinsic to be finalized on the chain before returning `True`,
691
692
or returns `False` if the extrinsic fails to be finalized within the timeout.
693
+ :param era: the period (in blocks) for which the transaction should remain valid.
692
694
:param prompt: If `True`, the call waits for confirmation from the user before proceeding.
693
695
694
- :return: Flag is `True` if extrinsic was finalized or included in the block. If we did not wait for
695
- finalization/inclusion, the response is `True`.
696
+ :return: (success, msg), where success is `True` if extrinsic was finalized or included in the block. If we did not
697
+ wait for finalization/inclusion, the response is `True`.
696
698
"""
697
699
698
700
if not (unlock_status := unlock_key (wallet , print_out = False )).success :
@@ -735,12 +737,12 @@ async def burned_register_extrinsic(
735
737
if not neuron .is_null :
736
738
console .print (
737
739
":white_heavy_check_mark: [dark_sea_green3]Already Registered[/dark_sea_green3]:\n "
738
- f"uid: [{ COLOR_PALETTE [ 'GENERAL' ][ ' NETUID_EXTRA' ] } ]{ neuron .uid } [/{ COLOR_PALETTE [ 'GENERAL' ][ ' NETUID_EXTRA' ] } ]\n "
739
- f"netuid: [{ COLOR_PALETTE [ 'GENERAL' ][ ' NETUID' ] } ]{ neuron .netuid } [/{ COLOR_PALETTE [ 'GENERAL' ][ ' NETUID' ] } ]\n "
740
- f"hotkey: [{ COLOR_PALETTE [ 'GENERAL' ][ 'HOTKEY' ] } ]{ neuron .hotkey } [/{ COLOR_PALETTE [ 'GENERAL' ][ 'HOTKEY' ] } ]\n "
741
- f"coldkey: [{ COLOR_PALETTE [ 'GENERAL' ][ 'COLDKEY' ] } ]{ neuron .coldkey } [/{ COLOR_PALETTE [ 'GENERAL' ][ 'COLDKEY' ] } ]"
740
+ f"uid: [{ COLOR_PALETTE . G . NETUID_EXTRA } ]{ neuron .uid } [/{ COLOR_PALETTE . G . NETUID_EXTRA } ]\n "
741
+ f"netuid: [{ COLOR_PALETTE . G . NETUID } ]{ neuron .netuid } [/{ COLOR_PALETTE . G . NETUID } ]\n "
742
+ f"hotkey: [{ COLOR_PALETTE . G . HK } ]{ neuron .hotkey } [/{ COLOR_PALETTE . G . HK } ]\n "
743
+ f"coldkey: [{ COLOR_PALETTE . G . CK } ]{ neuron .coldkey } [/{ COLOR_PALETTE . G . CK } ]"
742
744
)
743
- return True
745
+ return True , "Already registered"
744
746
745
747
with console .status (
746
748
":satellite: Recycling TAO for Registration..." , spinner = "aesthetic"
@@ -760,7 +762,7 @@ async def burned_register_extrinsic(
760
762
if not success :
761
763
err_console .print (f":cross_mark: [red]Failed[/red]: { err_msg } " )
762
764
await asyncio .sleep (0.5 )
763
- return False
765
+ return False , err_msg
764
766
# Successful registration, final check for neuron and pubkey
765
767
else :
766
768
with console .status (":satellite: Checking Balance..." , spinner = "aesthetic" ):
@@ -781,20 +783,21 @@ async def burned_register_extrinsic(
781
783
782
784
console .print (
783
785
"Balance:\n "
784
- f" [blue]{ old_balance } [/blue] :arrow_right: [{ COLOR_PALETTE ['STAKE' ]['STAKE_AMOUNT' ]} ]{ new_balance } [/{ COLOR_PALETTE ['STAKE' ]['STAKE_AMOUNT' ]} ]"
786
+ f" [blue]{ old_balance } [/blue] :arrow_right: "
787
+ f"[{ COLOR_PALETTE .S .STAKE_AMOUNT } ]{ new_balance } [/{ COLOR_PALETTE .S .STAKE_AMOUNT } ]"
785
788
)
786
789
787
790
if len (netuids_for_hotkey ) > 0 :
788
791
console .print (
789
792
f":white_heavy_check_mark: [green]Registered on netuid { netuid } with UID { my_uid } [/green]"
790
793
)
791
- return True
794
+ return True , f"Registered on { netuid } with UID { my_uid } "
792
795
else :
793
796
# neuron not found, try again
794
797
err_console .print (
795
798
":cross_mark: [red]Unknown error. Neuron not found.[/red]"
796
799
)
797
- return False
800
+ return False , "Unknown error. Neuron not found."
798
801
799
802
800
803
async def run_faucet_extrinsic (
@@ -914,7 +917,6 @@ async def run_faucet_extrinsic(
914
917
)
915
918
916
919
# process if registration successful, try again if pow is still valid
917
- await response .process_events ()
918
920
if not await response .is_success :
919
921
err_console .print (
920
922
f":cross_mark: [red]Failed[/red]: "
@@ -1757,7 +1759,8 @@ async def swap_hotkey_extrinsic(
1757
1759
)
1758
1760
if not len (netuids_registered ) > 0 :
1759
1761
err_console .print (
1760
- f"Destination hotkey [dark_orange]{ new_wallet .hotkey .ss58_address } [/dark_orange] is not registered. Please register and try again"
1762
+ f"Destination hotkey [dark_orange]{ new_wallet .hotkey .ss58_address } [/dark_orange] is not registered. "
1763
+ f"Please register and try again"
1761
1764
)
1762
1765
return False
1763
1766
@@ -1774,7 +1777,8 @@ async def swap_hotkey_extrinsic(
1774
1777
):
1775
1778
return False
1776
1779
print_verbose (
1777
- f"Swapping { wallet .name } 's hotkey ({ wallet .hotkey .ss58_address } ) with { new_wallet .name } s hotkey ({ new_wallet .hotkey .ss58_address } )"
1780
+ f"Swapping { wallet .name } 's hotkey ({ wallet .hotkey .ss58_address } ) with "
1781
+ f"{ new_wallet .name } s hotkey ({ new_wallet .hotkey .ss58_address } )"
1778
1782
)
1779
1783
with console .status (":satellite: Swapping hotkeys..." , spinner = "aesthetic" ):
1780
1784
call = await subtensor .substrate .compose_call (
0 commit comments