Skip to content

Commit 90a9765

Browse files
davidgumbergluke-jr
authored andcommitted
test: Migration of a wallet ending in /
Github-Pull: bitcoin#32273 Rebased-From: f0bb3d5
1 parent 9516979 commit 90a9765

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/functional/wallet_migration.py

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

585+
def test_wallet_with_path_ending_in_slash(self):
586+
self.log.info("Test migrating a wallet with a name/path ending in '/'")
587+
588+
# The last directory in the wallet's path
589+
final_dir = "mywallet"
590+
wallet_name = f"path/to/{final_dir}/"
591+
wallet = self.create_legacy_wallet(wallet_name)
592+
default = self.master_node.get_wallet_rpc(self.default_wallet_name)
593+
594+
addr = wallet.getnewaddress()
595+
txid = default.sendtoaddress(addr, 1)
596+
self.generate(self.master_node, 1)
597+
bals = wallet.getbalances()
598+
599+
_, wallet = self.migrate_and_get_rpc(wallet_name)
600+
601+
assert wallet.gettransaction(txid)
602+
603+
assert_equal(bals, wallet.getbalances())
604+
585605
def clear_default_wallet(self, backup_file):
586606
# Test cleanup: Clear unnamed default wallet for subsequent tests
587607
(self.old_node.wallets_path / "wallet.dat").unlink()
@@ -1624,6 +1644,7 @@ def run_test(self):
16241644
self.test_nonexistent()
16251645
self.test_unloaded_by_path()
16261646
self.test_wallet_with_relative_path()
1647+
self.test_wallet_with_path_ending_in_slash()
16271648

16281649
migration_failure_cases = [
16291650
"",

0 commit comments

Comments
 (0)