test: Migration of a wallet ending in ../

This commit is contained in:
David Gumberg
2025-07-03 15:30:18 -07:00
parent f0bb3d50fe
commit 76fe0e59ec

View File

@@ -637,6 +637,24 @@ class WalletMigrationTest(BitcoinTestFramework):
assert_equal(bals, wallet.getbalances())
def test_wallet_with_path_ending_in_relative_specifier(self):
self.log.info("Test migrating a wallet with a name/path ending in a relative specifier, '..'")
wallet_ending_in_relative = "path/that/ends/in/.."
# the wallet data is actually inside of path/that/ends/
wallet = self.create_legacy_wallet(wallet_ending_in_relative)
default = self.master_node.get_wallet_rpc(self.default_wallet_name)
addr = wallet.getnewaddress()
txid = default.sendtoaddress(addr, 1)
self.generate(self.master_node, 1)
bals = wallet.getbalances()
_, wallet = self.migrate_and_get_rpc(wallet_ending_in_relative)
assert wallet.gettransaction(txid)
assert_equal(bals, wallet.getbalances())
def test_default_wallet(self):
self.log.info("Test migration of the wallet named as the empty string")
wallet = self.create_legacy_wallet("")
@@ -1529,6 +1547,7 @@ class WalletMigrationTest(BitcoinTestFramework):
self.test_unloaded_by_path()
self.test_wallet_with_relative_path()
self.test_wallet_with_path_ending_in_slash()
self.test_wallet_with_path_ending_in_relative_specifier()
self.test_default_wallet()
self.test_direct_file()
self.test_addressbook()