test: add coverage for importdescriptor with an encrypted wallet

This commit is contained in:
Pol Espinasa
2026-04-29 13:43:52 +02:00
parent 5f33da9aa3
commit 84d07e471c

View File

@@ -762,6 +762,10 @@ class ImportDescriptorsTest(BitcoinTestFramework):
self.nodes[0].createwallet("encrypted_wallet", blank=True, passphrase="passphrase")
encrypted_wallet = self.nodes[0].get_wallet_rpc("encrypted_wallet")
self.log.info("Wallet must be unlocked to import a descriptor")
assert_raises_rpc_error(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.",
encrypted_wallet.importdescriptors, [descriptor])
descriptor["timestamp"] = 0
descriptor["next_index"] = 0