-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: servicesnames
field in getpeerinfo
and getnetworkinfo
#16850
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
servicesnames
field in getpeerinfo
and getnetworkinfo
servicesnames
field in getpeerinfo
and getnetworkinfo
Could someone restart the stopped job (583339836) please ? |
servicesnames
field in getpeerinfo
and getnetworkinfo
servicesnames
field in getpeerinfo
and getnetworkinfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK, thanks for writing tests.
In getpeerinfo and getnetworkinfo
Since it's the name of the RPC call
2791ed0
to
1d524c6
Compare
Rebased to regroup into a function as suggested by @MarcoFalke. |
ACK 1d524c6 |
…tworkinfo` 1d524c6 tests: rename 'test_getnetworkinginfo' in 'test_getnetworkinfo' (darosior) 07a8f65 tests: add a test for the 'servicesnames' RPC field (darosior) Pull request description: As per #16787 (comment), fixes #16844. This adds a test for both commands in the first commit and renames the test for `getnetworkinfo` in the second commit. ACKs for top commit: laanwj: ACK 1d524c6 Tree-SHA512: 8267dce4d54356debab75014e6f9ba885b892da605ed32f26a5446c232992fcae761861bb678adbdb942815d4706f3768c70deee6afec68f219b23605475be01
In getpeerinfo and getnetworkinfo Github-Pull: bitcoin#16850 Rebased-From: 07a8f65
Summary: This adds a test for both commands in the first commit and renames the test for getnetworkinfo. Depends on D7948 This is a backport of Core [[bitcoin/bitcoin#16850 | PR16850]] Test Plan: `ninja && test/functional/test_runner.py rpc_net.py` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7949
Summary: The tests added in [[bitcoin/bitcoin#16850 | PR16850]] assumed that the field `localservices` returned by `getnetworkinfo` was a string representation of an integer, when it is really a string representation of a hex. This fixes the test to decode the field properly and do the correct bitwise comparisons. This is a backport of Core [[bitcoin/bitcoin#16991 | PR16991]] Test Plan: `ninja && ./test/functional/test_runner.py rpc_net.py` ``` $ bitcoin-cli getnetworkinfo ... "localservices": "0000000000000425", "localservicesnames": [ "NETWORK", "BLOOM", "BITCOIN_CASH", "NETWORK_LIMITED" ], ... $ python >>> int("425", 16) 1061 >>> NODE_NETWORK = (1 << 0) >>> NODE_BLOOM = (1 << 2) >>> NODE_BITCOIN_CASH = (1 << 5) >>> NODE_NETWORK_LIMITED = (1 << 10) >>> NODE_NETWORK | NODE_BLOOM | NODE_BITCOIN_CASH | NODE_NETWORK_LIMITED 1061 >>> ``` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8083
As per #16787 (comment), fixes #16844.
This adds a test for both commands in the first commit and renames the test for
getnetworkinfo
in the second commit.