From 9700c21704ddad4be07df44393e39057fa386c56 Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 26 Jun 2024 16:44:44 -0300 Subject: [PATCH] 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. --- test/functional/wallet_migration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/wallet_migration.py b/test/functional/wallet_migration.py index aa0aefa7b5a63d..8fdc284d241d65 100755 --- a/test/functional/wallet_migration.py +++ b/test/functional/wallet_migration.py @@ -471,6 +471,12 @@ def test_encrypted(self): 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()