0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

test: verify wallet is still active post-migration failure

The migration process reloads the wallet after all failures.
This commit tests the behavior by trying to obtain a new address
after a decryption failure during migration.
This commit is contained in:
furszy 2024-06-26 16:44:44 -03:00 committed by Ava Chow
parent 771bc60f13
commit 8ce3739edb

View file

@ -471,6 +471,12 @@ class WalletMigrationTest(BitcoinTestFramework):
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", wallet.migratewallet, None, "badpass")
assert_raises_rpc_error(-4, "The passphrase contains a null character", wallet.migratewallet, None, "pass\0with\0null")
# Check the wallet is still active post-migration failure.
# If not, it will throw an exception and abort the test.
wallet.walletpassphrase("pass", 99999)
wallet.getnewaddress()
# Verify we can properly migrate the encrypted wallet
self.migrate_wallet(wallet, passphrase="pass")
info = wallet.getwalletinfo()