mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
refactor: wallet_importdescriptors to separate run_test() contents into specific functions #36402
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36402
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor-wallet-importdescriptors-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The motivation behind this PR came when reviewing a PR related with
wallet_importdescriptorsand I noticed that therun_test()function was more than 800 lines of code long, and looked messy and confusing, specially for someone not familiar with that test suite.I believe refactoring the contents inside
run_test()and separating it into specific functions would make the test easier to understand and to add new future test cases.To review this PR, I recommend using the following command to easily see that the changes are only code movement and function organization:
Suggestions about the new functions, organization, or their order are more than welcome. The approach I took is the one I felt would provide a good balance between keeping the code clean and making the changes as easy as possible to review.
If reviewers would prefer to split this into multiple commits, I'm also happy to do so.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
test/functional/wallet_importdescriptors.py:we can use import and use multisig→we can import and use multisig[the original phrasing is grammatically broken]Possible places where named args for integral literals may be used (e.g.
func(x, /*named_arg=*/0)in C++, andfunc(x, named_arg=0)in Python):test/functional/wallet_importdescriptors.py:multi_priv_big.sendtoaddress(w0.getnewaddress(), 10, "", "", True)2026-11-06 20:28:24
🔵 Suggestion · Split the remaining multisig test into focused helpers
test_multisig_descriptors(head lines 489-749, about 260 lines) still bundles private/watch-only multisig, distributed-key signing, large P2WSH/P2SH multisig and amendment. Finding or extending one scenario means reading the whole helper. Baserun_testgrouped these the same way, inline.Location:
test/functional/wallet_importdescriptors.py:489(head).Review coverage was incomplete.
Reviewed:
1dbe6869cece· Full review report · Previous reportspermalink
Approach aCK
Concept ACK
There are some unnecessary new lines added and removed that add noise to the color-dimmed filter :)
I've tried to avoid them as much as possible, but some of them are necessary to re-arrange into new functions keeping the separations of the original tests intact.
🐙 This pull request conflicts with the target branch and needs rebase.
Rebased on master
I think this looks pretty good
this does not only test combo descriptors, maybe should drop combo from the function name?
agree, changed!
Concept ACK
1dbe6869ceaddressed ralph's suggestion fortest_next_index(line 938) to issue indices 0-4 from a different origin descriptor over the same xpub, to still test returning already handed-out scripts as it did before the refactorACK
1dbe6869ce