test: use ExtendedPrivateKey in feature_notifications.py
What changed, and why it matters
This commit changes a single Bitcoin test file to generate a random test private key instead of using a hardcoded one. It is a test-only quality improvement with no effect on the actual Bitcoin software users run.
No security action needed. This is a routine test refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test/functional/feature_notifications.py, the hardcoded test extended private key (xpriv) string is replaced by a freshly generated ExtendedPrivateKey. The generated key is converted to string and used identically in the same descriptor import test path. No production code, wallet logic, consensus code, or network behavior is modified.
Changed components
test/functional/feature_notifications.pyInspect captured patch +2 / −1
diff --git a/test/functional/feature_notifications.py b/test/functional/feature_notifications.py
index 9c409b32..e983d5a2 100755
--- a/test/functional/feature_notifications.py
+++ b/test/functional/feature_notifications.py
@@ -11,6 +11,7 @@ from test_framework.blocktools import (
create_block,
)
from test_framework.descriptors import descsum_create
+from test_framework.extendedkey import ExtendedPrivateKey
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
@@ -74,7 +75,7 @@ class NotificationsTest(BitcoinTestFramework):
def run_test(self):
if self.is_wallet_compiled():
# Setup the descriptors to be imported to the wallet
- xpriv = "tprv8ZgxMBicQKsPfHCsTwkiM1KT56RXbGGTqvc2hgqzycpwbHqqpcajQeMRZoBD35kW4RtyCemu6j34Ku5DEspmgjKdt2qe4SvRch5Kk8B8A2v"
+ xpriv = ExtendedPrivateKey.generate().to_string()
desc_imports = [{
"desc": descsum_create(f"wpkh({xpriv}/0/*)"),
"timestamp": 0,
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.