Skip to content

Commit 5e21821

Browse files
committed
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.
1 parent 5174565 commit 5e21821

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/functional/wallet_migration.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,16 @@ def test_encrypted(self):
485485

486486
# Use self.migrate_and_get_rpc to test this error to get everything copied over to the master node
487487
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.migrate_and_get_rpc, "encrypted")
488+
488489
# Use the RPC directly on the master node for the rest of these checks
490+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
489491
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.master_node.migratewallet, "encrypted", "badpass")
492+
493+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
490494
assert_raises_rpc_error(-4, "The passphrase contains a null character", self.master_node.migratewallet, "encrypted", "pass\0with\0null")
491495

492496
# Verify we can properly migrate the encrypted wallet
497+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
493498
self.master_node.migratewallet("encrypted", passphrase="pass")
494499
wallet = self.master_node.get_wallet_rpc("encrypted")
495500

0 commit comments

Comments
 (0)