aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-11-28 18:30:40 -0500
committerfanquake <fanquake@gmail.com>2022-12-01 10:21:37 +0000
commitd464b2af30f2b02be2ce0b5e45dc6c141529dba5 (patch)
tree4ecb28d5d21f8c4fd8cb2a9a4b11eff53d9264d7
parent7a97a56ffb22fbf8ccb143a8a7da77e8c7e77069 (diff)
downloadbitcoin-d464b2af30f2b02be2ce0b5e45dc6c141529dba5.tar.xz
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: 88afc73ae0c67a4482ecd3d77eb2a8fd2673f82d
-rwxr-xr-xtest/functional/wallet_migration.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/wallet_migration.py b/test/functional/wallet_migration.py
index 3c1cb6ac32..355046c9af 100755
--- a/test/functional/wallet_migration.py
+++ b/test/functional/wallet_migration.py
@@ -393,6 +393,16 @@ class WalletMigrationTest(BitcoinTestFramework):
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):
self.generate(self.nodes[0], 101)
@@ -402,6 +412,7 @@ class WalletMigrationTest(BitcoinTestFramework):
self.test_other_watchonly()
self.test_no_privkeys()
self.test_pk_coinbases()
+ self.test_encrypted()
if __name__ == '__main__':
WalletMigrationTest().main()