P2P_SERVICES is defined in test/functional/test_framework/p2p.py, so we can use it as a single definition for our functional tests. It may also be a tiny bit more efficient to use the constant rather than calculating NODE_NETWORK | NODE_WITNESS every time we need it in the tests.
test: use test_framework.p2p `P2P_SERVICES` constant in functional tests #23036
pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:use-test_framework-P2P_SERVICES-in-functional-tests changing 6 files +35 −28-
jonatack commented at 2:53 PM on September 19, 2021: member
-
test: use test_framework.p2p P2P_SERVICES in functional tests b69a106bcd
-
DrahtBot commented at 3:20 PM on September 19, 2021: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #23035 (p2p, rpc, test: expose tried and refcount in getnodeaddresses, update/improve tests by jonatack)
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.
- klementtan approved
-
klementtan commented at 3:58 PM on September 19, 2021: contributor
crACK b69a106bcd8ddefdb810df6ebb3625c430197e04
- Verified that refactoring
NODE_NETWORK | NODE_WITNESStoP2P_SERVICESand reordering of imports is the only change. - Also verified that all instances of
NODE_NETWORK | NODE_WITNESShave been refactored withgit grep NODE_WITNESS.
- Verified that refactoring
- DrahtBot added the label Tests on Sep 19, 2021
-
laanwj commented at 12:27 PM on September 21, 2021: member
Code review ACK b69a106bcd8ddefdb810df6ebb3625c430197e04 I think it's good to use a constant for the default service flags, if there is no reason to specifically deviate from them.
It may also be a tiny bit more efficient to use the constant
Bitwise OR is one of the most efficient operations to perform on a CPU. Also, none of these are in inner loops. I strongly doubt this figures into test run time in any noticeable way :smile:
-
jonatack commented at 12:53 PM on September 21, 2021: member
(Thanks!) Yes, that definitely was not the main argument for it :)
- fanquake approved
-
fanquake commented at 8:36 AM on September 23, 2021: member
ACK b69a106bcd8ddefdb810df6ebb3625c430197e04 - didn't look at the formatting changes.
- fanquake merged this on Sep 23, 2021
- fanquake closed this on Sep 23, 2021
- jonatack deleted the branch on Sep 23, 2021
- sidhujag referenced this in commit b3fa4e1f79 on Sep 24, 2021
- DrahtBot locked this on Oct 30, 2022