Skip to content

Commit 8ce3739

Browse files
furszyachow101
authored andcommitted
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.
1 parent 771bc60 commit 8ce3739

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/wallet_migration.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,12 @@ def test_encrypted(self):
471471
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", wallet.migratewallet, None, "badpass")
472472
assert_raises_rpc_error(-4, "The passphrase contains a null character", wallet.migratewallet, None, "pass\0with\0null")
473473

474+
# Check the wallet is still active post-migration failure.
475+
# If not, it will throw an exception and abort the test.
476+
wallet.walletpassphrase("pass", 99999)
477+
wallet.getnewaddress()
478+
479+
# Verify we can properly migrate the encrypted wallet
474480
self.migrate_wallet(wallet, passphrase="pass")
475481

476482
info = wallet.getwalletinfo()

0 commit comments

Comments
 (0)