Skip to content

Commit 2f1c60d

Browse files
committed
Updates test_wallet_creations.py
1 parent 8152b1e commit 2f1c60d

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

tests/e2e_tests/test_wallet_creations.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import time
55
from typing import Dict, Optional, Tuple
66

7+
from bittensor_wallet import Wallet
8+
79
"""
810
Verify commands:
911
@@ -412,6 +414,9 @@ def test_wallet_regen(wallet_setup, capfd):
412414
# -----------------------------
413415
print("Testing wallet regen_coldkey command 🧪")
414416
coldkey_path = os.path.join(wallet_path, "new_wallet", "coldkey")
417+
initial_coldkey_ss58 = Wallet(
418+
name="new_wallet", path=wallet_path
419+
).coldkey.ss58_address
415420
initial_coldkey_mod_time = os.path.getmtime(coldkey_path)
416421

417422
result = exec_command(
@@ -439,24 +444,28 @@ def test_wallet_regen(wallet_setup, capfd):
439444
assert (
440445
initial_coldkey_mod_time != new_coldkey_mod_time
441446
), "Coldkey file was not regenerated as expected"
442-
# Underlying Rust is broken. Will add this in when that is fixed: https://github.com/opentensor/btwallet/issues/118
443-
# json_result = exec_command(
444-
# command="wallet",
445-
# sub_command="regen-coldkey",
446-
# extra_args=[
447-
# "--wallet-name",
448-
# "new_wallet",
449-
# "--hotkey",
450-
# "new_hotkey",
451-
# "--wallet-path",
452-
# wallet_path,
453-
# "--mnemonic",
454-
# mnemonics["coldkey"],
455-
# "--no-use-password",
456-
# "--overwrite",
457-
# "--json-output"
458-
# ],
459-
# )
447+
json_result = exec_command(
448+
command="wallet",
449+
sub_command="regen-coldkey",
450+
extra_args=[
451+
"--wallet-name",
452+
"new_wallet",
453+
"--hotkey",
454+
"new_hotkey",
455+
"--wallet-path",
456+
wallet_path,
457+
"--mnemonic",
458+
mnemonics["coldkey"],
459+
"--no-use-password",
460+
"--overwrite",
461+
"--json-output",
462+
],
463+
)
464+
465+
json_result_out = json.loads(json_result.stdout)
466+
assert json_result_out["success"] is True
467+
assert json_result_out["data"]["name"] == "new_wallet"
468+
assert json_result_out["data"]["coldkey_ss58"] == initial_coldkey_ss58
460469

461470
# -----------------------------
462471
# Command 2: <btcli w regen_coldkeypub>

0 commit comments

Comments
 (0)