Sitelet https://web.archive.org/web/20200907225741/https://github.com/bitcoin/bitcoin/issues/19821
Skip to content
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

test: Remove confusing connect_nodes global #19821

Open
MarcoFalke opened this issue Aug 27, 2020 · 3 comments
Open

test: Remove confusing connect_nodes global #19821

MarcoFalke opened this issue Aug 27, 2020 · 3 comments

Comments

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Aug 27, 2020

connect_nodes(self.nodes[a], b) is confusing because

  • the types of the arguments differ
  • the test framework is aware of all nodes, so solving a to self.nodes[a] can be done hidden from the caller

This should be fixed by replacing connect_nodes(self.nodes[a], b) with self.connect_nodes(a, b) and removing the global connect_nodes.

@slmtpz
Copy link
Contributor

@slmtpz slmtpz commented Aug 27, 2020 •

Can I also pick this up? Or do we have a "good second issue" for me that does not require a lot of bitcoin logic yet and could help me understand further?

@MarcoFalke
Copy link
Member Author

@MarcoFalke MarcoFalke commented Aug 27, 2020

@slmtpz You may also help with review, as explained in https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#contributing-to-bitcoin-core Currently there are about 400 open pull request, so I am sure there is something in for you.

If not, apart from the good first issues, there are also ones that are up for grabs. Some of them might no longer be applicable. So if you are interested, but unsure, you might want to leave a comment on the issue first.

Generally, you can also write tests to improve the coverage. Any kind of test is welcome and coverage information can be obtained from a relatively recent coverage report. If you are unsure, don't hesitate to check back first.

@prayank23
Copy link

@prayank23 prayank23 commented Aug 28, 2020 •

So we just need to replace connect_nodes(self.nodes[a], b) with self.connect_nodes(a, b) and remove the global connect_nodes ?

https://github.com/search?l=&q=connect_nodes+repo%3Abitcoin%2Fbitcoin%2Ftest&type=Code

For example:

Remove line 42

And replace line 65,66 and 67 here:

connect_nodes(self.nodes[0], 3)

with following:

self.connect_nodes(0, 3)
self.connect_nodes(1, 3)
self.connect_nodes(2, 3)
self.connect_nodes(2, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.