Skip to content

Commit f0bb3d5

Browse files
committed
test: Migration of a wallet ending in /
1 parent 41faef5 commit f0bb3d5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/functional/wallet_migration.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,26 @@ def test_wallet_with_relative_path(self):
617617
assert_equal(info["descriptors"], False)
618618
assert_equal(info["format"], "bdb")
619619

620+
def test_wallet_with_path_ending_in_slash(self):
621+
self.log.info("Test migrating a wallet with a name/path ending in '/'")
622+
623+
# The last directory in the wallet's path
624+
final_dir = "mywallet"
625+
wallet_name = f"path/to/{final_dir}/"
626+
wallet = self.create_legacy_wallet(wallet_name)
627+
default = self.master_node.get_wallet_rpc(self.default_wallet_name)
628+
629+
addr = wallet.getnewaddress()
630+
txid = default.sendtoaddress(addr, 1)
631+
self.generate(self.master_node, 1)
632+
bals = wallet.getbalances()
633+
634+
_, wallet = self.migrate_and_get_rpc(wallet_name)
635+
636+
assert wallet.gettransaction(txid)
637+
638+
assert_equal(bals, wallet.getbalances())
639+
620640
def test_default_wallet(self):
621641
self.log.info("Test migration of the wallet named as the empty string")
622642
wallet = self.create_legacy_wallet("")
@@ -1508,6 +1528,7 @@ def run_test(self):
15081528
self.test_nonexistent()
15091529
self.test_unloaded_by_path()
15101530
self.test_wallet_with_relative_path()
1531+
self.test_wallet_with_path_ending_in_slash()
15111532
self.test_default_wallet()
15121533
self.test_direct_file()
15131534
self.test_addressbook()

0 commit comments

Comments
 (0)