File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -269,10 +269,26 @@ def get_hotkey_wallets_for_wallet(
269
269
except FileNotFoundError :
270
270
hotkeys = []
271
271
for h_name in hotkeys :
272
- hotkey_for_name = Wallet (path = str (wallet_path ), name = wallet .name , hotkey = h_name )
272
+ if h_name .endswith ("pub.txt" ):
273
+ if h_name .split ("pub.txt" )[0 ] in hotkeys :
274
+ continue
275
+ else :
276
+ hotkey_for_name = Wallet (
277
+ path = str (wallet_path ),
278
+ name = wallet .name ,
279
+ hotkey = h_name .split ("pub.txt" )[0 ],
280
+ )
281
+ else :
282
+ hotkey_for_name = Wallet (
283
+ path = str (wallet_path ), name = wallet .name , hotkey = h_name
284
+ )
273
285
try :
286
+ exists = (
287
+ hotkey_for_name .hotkey_file .exists_on_device ()
288
+ or hotkey_for_name .hotkeypub_file .exists_on_device ()
289
+ )
274
290
if (
275
- ( exists := hotkey_for_name . hotkey_file . exists_on_device ())
291
+ exists
276
292
and not hotkey_for_name .hotkey_file .is_encrypted ()
277
293
# and hotkey_for_name.coldkeypub.ss58_address
278
294
and get_hotkey_pub_ss58 (hotkey_for_name )
Original file line number Diff line number Diff line change @@ -846,12 +846,21 @@ async def wallet_list(wallet_path: str, json_output: bool):
846
846
data = f"[bold red]Hotkey[/bold red][green] { hkey } [/green] (?)"
847
847
hk_data = {"name" : hkey .name , "ss58_address" : "?" }
848
848
if hkey :
849
- hkey_ss58 = get_hotkey_pub_ss58 (hkey )
849
+ try :
850
+ hkey_ss58 = hkey .get_hotkey ().ss58_address
851
+ pub_only = False
852
+ except KeyFileError :
853
+ hkey_ss58 = hkey .get_hotkeypub ().ss58_address
854
+ pub_only = True
850
855
try :
851
856
data = (
852
857
f"[bold red]Hotkey[/bold red] [green]{ hkey .hotkey_str } [/green] "
853
- f"ss58_address [green]{ hkey_ss58 } [/green]\n "
858
+ f"ss58_address [green]{ hkey_ss58 } [/green]"
854
859
)
860
+ if pub_only :
861
+ data += " [blue](hotkeypub only)[/blue]\n "
862
+ else :
863
+ data += "\n "
855
864
hk_data ["name" ] = hkey .hotkey_str
856
865
hk_data ["ss58_address" ] = hkey_ss58
857
866
except UnicodeDecodeError :
You can’t perform that action at this time.
0 commit comments