mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02: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:
parent
771bc60f13
commit
8ce3739edb
@ -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, "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")
|
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")
|
self.migrate_wallet(wallet, passphrase="pass")
|
||||||
|
|
||||||
info = wallet.getwalletinfo()
|
info = wallet.getwalletinfo()
|
||||||
|
Loading…
Reference in New Issue
Block a user