Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Sep 30, 2019

Rebase of #16936

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9c23ebd

Thank you @luke-jr for fixing my mistakes..

laanwj added a commit that referenced this pull request Sep 30, 2019
…luke-jr)

9c23ebd qa: Fix service flag comparison check in rpc_net test (Luke Dashjr)

Pull request description:

  Rebase of #16936

ACKs for top commit:
  darosior:
    ACK 9c23ebd

Tree-SHA512: 74f287740403da1040ab1e235ef6eba4e304f3ee5d57a3b25d1e2e1f2f982d256528d398a4d6cb24ba393798e680a8f46cd7dae54ed84ab2c747e96288f1f884
@laanwj laanwj merged commit 9c23ebd into bitcoin:master Sep 30, 2019
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 23, 2020
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants