Skip to content

Commit

Permalink
test: verify wallet is still active post-migration failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
furszy authored and achow101 committed Jun 26, 2024
1 parent 886912d commit 9700c21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/functional/wallet_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 9700c21

Please sign in to comment.