test: use ExtendedPrivateKey in wallet_bumpfee.py
What changed, and why it matters
This commit changes a single test file to generate a random private key instead of using a hardcoded one. It is a test-only cleanup with no effect on the actual Bitcoin Core software users run.
No action needed. This is a benign test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/wallet_bumpfee.py. It replaces two hardcoded test extended private keys (tprv…) with dynamically generated keys using ExtendedPrivateKey.generate() and wraps them with descsum_create(). The change only affects functional tests and does not alter node, wallet, or consensus code.
Changed components
test/functional/wallet_bumpfee.pyInspect captured patch +4 / −2
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
index b07425c1..ee0c0451 100755
--- a/test/functional/wallet_bumpfee.py
+++ b/test/functional/wallet_bumpfee.py
@@ -18,6 +18,8 @@ from decimal import Decimal
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 (
MAX_BIP125_RBF_SEQUENCE,
MAX_SEQUENCE_NONFINAL,
@@ -546,9 +548,9 @@ def test_maxtxfee_fails(self, rbf_node, dest_address):
def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
self.log.info('Test that PSBT is returned for bumpfee in watchonly wallets')
- priv_rec_desc = "wpkh([00000001/84'/1'/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0/*)#rweraev0"
+ priv_rec_desc = descsum_create(f"wpkh([00000001/84'/1'/0']{ExtendedPrivateKey.generate().to_string()}/0/*)")
pub_rec_desc = rbf_node.getdescriptorinfo(priv_rec_desc)["descriptor"]
- priv_change_desc = "wpkh([00000001/84'/1'/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/*)#j6uzqvuh"
+ priv_change_desc = descsum_create(f"wpkh([00000001/84'/1'/0']{ExtendedPrivateKey.generate().to_string()}/1/*)")
pub_change_desc = rbf_node.getdescriptorinfo(priv_change_desc)["descriptor"]
# Create a wallet with private keys that can sign PSBTs
rbf_node.createwallet(wallet_name="signer", disable_private_keys=False, blank=True)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.