#35619 test: ExtendedPrivateKey follow-ups
https://github.com/bitcoin/bitcoin/pull/35619 · · +18/-24 in 4 files, 2 commits · labels: Tests
Goal
- Make functional tests more consistent and easier to maintain by unifying test setup patterns
- Replace manual key derivations in descriptor tests with a shared test helper
This PR refactors functional tests to use the ExtendedPrivateKey test utility class introduced in #35543 in wallet_importdescriptors.py. It also unifies how tests avoid creating a default wallet by setting self.wallet_names = [] instead of overriding init_wallet with a no-op.
Problem: Functional tests had inconsistent patterns for disabling default wallet creation (some overriding init_wallet with a no-op, others configuring wallet_names), and wallet_importdescriptors.py still used hardcoded keys and manual address derivations rather than the shared ExtendedPrivateKey helper.
Category: Test infrastructure (#34 of 45)
P4 · cleanup
- P4 because it is a routine cleanup that does not fix flaky tests or improve CI signal
- Standardizing boilerplate and reusing existing test helpers provides minor maintenance benefit
P4 as a marginal test cleanup. It standardizes framework boilerplate and adopts an existing test helper without resolving flaky tests, improving CI signal, or adding significant test coverage.
Membership: Touches test_framework.py and standardizes framework usage conventions across functional test scripts.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0
Reviewability: Ready
- Ready for review
- Small change with passing CI and addressed feedback
The PR is small, CI is green, and the latest push has a reACK addressing previous reviewer nits.
Author status: active, addressed feedback with force-pushes
Resolved concerns:
- Initial confusion over removing init_wallet without configuring self.wallet_names was resolved by standardizing on self.wallet_names = [] across the tests (maflcko)
- Style nit reusing a key_origin variable in test assertions was adopted in a subsequent push (davidgumberg)
Agreement: Strong
- Strong support with previous feedback addressed
- Supported standardizing the pattern for suppressing default wallet creation (maflcko)
- Approved after review comments were addressed (davidgumberg)
Strong: pattern unification endorsed by maflcko and code reACKed by davidgumberg
Reviewers guided the standardization on self.wallet_names and davidgumberg provided a reACK on the latest head commit.
- maflcko noted that unifying the pattern for default wallet suppression improves test readability and endorsed the second commit
- davidgumberg gave a reACK after review comments were addressed
Review verdicts (DrahtBot): 1
- ACK: davidgumberg
Files
42 lines under test/bench/ci.
- test/functional/wallet_importdescriptors.py +15/-17
- test/functional/wallet_listdescriptors.py +1/-4
- test/functional/wallet_taproot.py +1/-3
- test/functional/test_framework/test_framework.py +1/-0
Card
This PR cleans up functional tests by adopting the ExtendedPrivateKey utility class in wallet_importdescriptors.py and standardizing the pattern for avoiding default wallet creation using self.wallet_names. It is a minor test maintenance PR that improves test consistency without altering node or wallet behavior. Review is complete with an explicit reACK from davidgumberg and endorsement from maflcko, with no open blockers.