-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Remove connect_nodes global and Replace connect_nodes(self.nodes[a], b) with self.connect_nodes(a, b) #19945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace connect_nodes(self.nodes[a], b) with self.connect_nodes(a, b) and remove the global connect_nodes
A few things to note from the contributing guidelines.
If anything isn't clear or you need further help let us know. |
I can use a different branch in future or delete this if it's not acceptable.
|
I would recommend you fork both repositories (bitcoin/bitcoin and bitcoin-core/gui) individually and treat them as separate repos. In reality bitcoin/bitcoin pulls in changes made to bitcoin-core/gui but if you continue contributing you will be opening PRs and reviewing PRs on both repositories depending on whether it is GUI or not. Then you can have your master branch follow the master of each repo and set up topic branches off master.
Unless I am missing something this is a find and replace which can be done using a scripted-diff. I don't think this will be merged without a scripted-diff but someone more experienced can correct me if I am wrong.
As I said I don't think this will be merged as is. You'd need to close this PR to open a new PR from a topic branch and provide a scripted-diff. If you need help with the latter please say. |
Yeah nice work @prayank23. Hopefully this will be useful for future new contributors. Feel free to look at the scripted-diff commit in @robot-dreams PR and if it works, makes sense to you, you can review his PR by Approach ACKing or ACKing the commit. Any questions on the scripted-diff can be asked here or in the #bitcoin-core-pr-reviews channel on IRC. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
…ework methods 3c7d9ab test: Move (dis)?connect_nodes globals into TestFramework as helpers (Elliott Jin) 4b16c61 scripted-diff: test: Replace uses of (dis)?connect_nodes global (Prayank) be38684 test: Replace use of (dis)?connect_nodes globals (Elliott Jin) Pull request description: `util.py` defines global helper functions `connect_nodes` and `disconnect_nodes`; however, these functions are confusing because they take a node and an index (instead of two indexes). The `TestFramework` object has enough context to convert from `i` to `self.nodes[i]`, so we can replace all instances of `connect_nodes(self.nodes[a], b)` with `self.connect_nodes(a, b)`. Similarly, we can replace instances of `disconnect_nodes`. The approach taken in this PR builds on #19945 but uses a scripted-diff for the majority of the changes. Fixes: #19821 ACKs for top commit: MarcoFalke: ACK 3c7d9ab guggero: ACK 3c7d9ab Tree-SHA512: e027092748602904abcd986d7299624c8754c3236314b6d8e392e306741c212f266c2207e385adfb194f67ae6559a585ee7b15d639b1d65c4651dbf503e5931a
…estFramework methods 3c7d9ab test: Move (dis)?connect_nodes globals into TestFramework as helpers (Elliott Jin) 4b16c61 scripted-diff: test: Replace uses of (dis)?connect_nodes global (Prayank) be38684 test: Replace use of (dis)?connect_nodes globals (Elliott Jin) Pull request description: `util.py` defines global helper functions `connect_nodes` and `disconnect_nodes`; however, these functions are confusing because they take a node and an index (instead of two indexes). The `TestFramework` object has enough context to convert from `i` to `self.nodes[i]`, so we can replace all instances of `connect_nodes(self.nodes[a], b)` with `self.connect_nodes(a, b)`. Similarly, we can replace instances of `disconnect_nodes`. The approach taken in this PR builds on bitcoin#19945 but uses a scripted-diff for the majority of the changes. Fixes: bitcoin#19821 ACKs for top commit: MarcoFalke: ACK 3c7d9ab guggero: ACK 3c7d9ab Tree-SHA512: e027092748602904abcd986d7299624c8754c3236314b6d8e392e306741c212f266c2207e385adfb194f67ae6559a585ee7b15d639b1d65c4651dbf503e5931a
Made changes in 37 files based on the issue and solution suggested by MarcoFalke in #19821