test: `servicesnames` field in `getpeerinfo` and `getnetworkinfo` #16850

pull darosior wants to merge 2 commits into bitcoin:master from darosior:servicenames changing 2 files +38 −5
  1. darosior commented at 8:11 PM on September 10, 2019: member

    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.

  2. darosior renamed this:
    Functionnal tests for `servicesnames` field in `getpeerinfo` and `getnetworkinfo`
    Functional tests for `servicesnames` field in `getpeerinfo` and `getnetworkinfo`
    on Sep 10, 2019
  3. fanquake added the label Tests on Sep 10, 2019
  4. darosior commented at 9:36 PM on September 10, 2019: member

    Could someone restart the stopped job (583339836) please ? EDIT: Thanks !

  5. MarcoFalke renamed this:
    Functional tests for `servicesnames` field in `getpeerinfo` and `getnetworkinfo`
    test: `servicesnames` field in `getpeerinfo` and `getnetworkinfo`
    on Sep 11, 2019
  6. in test/functional/rpc_net.py:130 in 2791ed0d4a outdated
     124 | @@ -104,6 +125,18 @@ def _test_getpeerinfo(self):
     125 |          assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr'])
     126 |          assert_equal(peer_info[0][0]['minfeefilter'], Decimal("0.00000500"))
     127 |          assert_equal(peer_info[1][0]['minfeefilter'], Decimal("0.00001000"))
     128 | +        # check the `servicesnames` field
     129 | +        for info in peer_info:
     130 | +            if int(info[0]["services"]) & NODE_NETWORK:
    


    MarcoFalke commented at 8:48 AM on September 11, 2019:

    Could move this into a function for less duplication?

    assert_network_service_names(services=int(info[0]["services"]), names=info[0]["servicesnames"])
    

    jamesob commented at 2:28 PM on September 11, 2019:

    Agree.


    darosior commented at 3:27 PM on September 11, 2019:

    Done

  7. MarcoFalke approved
  8. MarcoFalke commented at 8:48 AM on September 11, 2019: member

    ACK

  9. jamesob commented at 2:28 PM on September 11, 2019: member

    Concept ACK, thanks for writing tests.

  10. tests: add a test for the 'servicesnames' RPC field
    In getpeerinfo and getnetworkinfo
    07a8f65031
  11. tests: rename 'test_getnetworkinginfo' in 'test_getnetworkinfo'
    Since it's the name of the RPC call
    1d524c62ea
  12. darosior force-pushed on Sep 11, 2019
  13. darosior commented at 3:27 PM on September 11, 2019: member

    Rebased to regroup into a function as suggested by @MarcoFalke.

  14. laanwj commented at 6:57 AM on September 12, 2019: member

    ACK 1d524c62ea679aa89770f9fdcd72b84f013639cb

  15. laanwj referenced this in commit 04d9939f46 on Sep 12, 2019
  16. laanwj merged this on Sep 12, 2019
  17. laanwj closed this on Sep 12, 2019

  18. luke-jr referenced this in commit 928f66571a on Sep 21, 2019
  19. jasonbcox referenced this in commit b32a7d9aef on Oct 16, 2020
  20. jasonbcox referenced this in commit 93159fb940 on Oct 23, 2020
  21. kittywhiskers referenced this in commit 8ccff1975e on Nov 6, 2021
  22. kittywhiskers referenced this in commit 10a90c656f on Dec 5, 2021
  23. kittywhiskers referenced this in commit 6bc7234a7f on Dec 5, 2021
  24. kittywhiskers referenced this in commit 68ae520768 on Dec 12, 2021
  25. kittywhiskers referenced this in commit 98465b2a59 on Dec 12, 2021
  26. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me