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:
parent
771bc60f13
commit
8ce3739edb
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue