test: increment mocked time for migrating wallet backups

The wallet backups performed before migration use the time as part of
their filename. As the time is mocked, increment it between migration
attempts to prevent file name conflicts which is a problem on Windows.
This commit is contained in:
Max Edwards
2025-06-25 21:06:10 +01:00
parent 5174565802
commit 5e2182140b

View File

@@ -485,11 +485,16 @@ class WalletMigrationTest(BitcoinTestFramework):
# Use self.migrate_and_get_rpc to test this error to get everything copied over to the master node
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.migrate_and_get_rpc, "encrypted")
# Use the RPC directly on the master node for the rest of these checks
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.master_node.migratewallet, "encrypted", "badpass")
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
assert_raises_rpc_error(-4, "The passphrase contains a null character", self.master_node.migratewallet, "encrypted", "pass\0with\0null")
# Verify we can properly migrate the encrypted wallet
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
self.master_node.migratewallet("encrypted", passphrase="pass")
wallet = self.master_node.get_wallet_rpc("encrypted")