Skip to content

Commit 9aacee8

Browse files
committed
Add test
1 parent 75501bb commit 9aacee8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/e2e_tests/test_wallet_creations.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* btcli w regen_coldkey
1717
* btcli w regen_coldkeypub
1818
* btcli w regen_hotkey
19+
* btcli w regen_hotkeypub
1920
"""
2021

2122

@@ -542,6 +543,34 @@ def test_wallet_regen(wallet_setup, capfd):
542543
)
543544
print("Passed wallet regen_hotkey command ✅")
544545

546+
hotkeypub_path = os.path.join(wallet_path, "new_wallet", "hotkeypub.txt")
547+
initial_hotkeypub_mod_time = os.path.getmtime(hotkeypub_path)
548+
result = exec_command(
549+
command="wallet",
550+
sub_command="regen-hotkeypub",
551+
extra_args=[
552+
"--wallet-name",
553+
"new_wallet",
554+
"--hotkey",
555+
"new_hotkey",
556+
"--wallet-path",
557+
wallet_path,
558+
"--ss58-address",
559+
ss58_address,
560+
"--overwrite",
561+
],
562+
)
563+
564+
# Wait a bit to ensure file system updates modification time
565+
time.sleep(2)
566+
567+
new_hotkeypub_mod_time = os.path.getmtime(hotkey_path)
568+
569+
assert initial_hotkeypub_mod_time != new_hotkeypub_mod_time, (
570+
"Hotkey file was not regenerated as expected"
571+
)
572+
print("Passed wallet regen_hotkeypub command ✅")
573+
545574

546575
def test_wallet_balance_all(local_chain, wallet_setup, capfd):
547576
"""

0 commit comments

Comments
 (0)