mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
tests: Test for migrating encrypted wallets
Due to an oversight, we cannot currently migrate encrypted wallets,
regardless of whether they are unlocked. Migrating such wallets will
trigger an error, and result in the cleanup being run. This conveniently
allows us to check some parts of the cleanup code.
Github-Pull: #26594
Rebased-From: 88afc73ae0
This commit is contained in:
parent
7a97a56ffb
commit
d464b2af30
1 changed files with 11 additions and 0 deletions
|
@ -393,6 +393,16 @@ class WalletMigrationTest(BitcoinTestFramework):
|
||||||
|
|
||||||
assert_equal(bals, wallet.getbalances())
|
assert_equal(bals, wallet.getbalances())
|
||||||
|
|
||||||
|
def test_encrypted(self):
|
||||||
|
self.log.info("Test migration of an encrypted wallet")
|
||||||
|
wallet = self.create_legacy_wallet("encrypted")
|
||||||
|
|
||||||
|
wallet.encryptwallet("pass")
|
||||||
|
|
||||||
|
wallet.walletpassphrase("pass", 10)
|
||||||
|
assert_raises_rpc_error(-4, "Error: Unable to produce descriptors for this legacy wallet. Make sure the wallet is unlocked first", wallet.migratewallet)
|
||||||
|
# TODO: Fix migratewallet so that we can actually migrate encrypted wallets
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.generate(self.nodes[0], 101)
|
self.generate(self.nodes[0], 101)
|
||||||
|
|
||||||
|
@ -402,6 +412,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
||||||
self.test_other_watchonly()
|
self.test_other_watchonly()
|
||||||
self.test_no_privkeys()
|
self.test_no_privkeys()
|
||||||
self.test_pk_coinbases()
|
self.test_pk_coinbases()
|
||||||
|
self.test_encrypted()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
WalletMigrationTest().main()
|
WalletMigrationTest().main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue