test: use ExtendedPrivateKey in wallet_descriptor.py

This commit is contained in:
rkrux
2026-06-17 14:49:51 +05:30
parent 4100fac20e
commit 06af0cddbb

View File

@@ -12,6 +12,8 @@ except ImportError:
import re
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.descriptors import descsum_create
from test_framework.extendedkey import ExtendedPrivateKey
from test_framework.messages import ser_string
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
@@ -173,7 +175,7 @@ class WalletDescriptorTest(BitcoinTestFramework):
self.log.info("Test that unlock is needed when deriving only hardened keys in an encrypted wallet")
with WalletUnlock(send_wrpc, "pass"):
send_wrpc.importdescriptors([{
"desc": "wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/*h)#y4dfsj7n",
"desc": descsum_create(f"wpkh({ExtendedPrivateKey.generate().to_string()}/0h/*h)"),
"timestamp": "now",
"range": [0,10],
"active": True