mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-27 15:51:26 +02:00
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:
@@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user