MCPcopy Create free account
hub / github.com/ElementsProject/elements / assert_net_servicesnames

Function assert_net_servicesnames

test/functional/rpc_net.py:31–41  ·  view source on GitHub ↗

Utility that checks if all flags are correctly decoded in `getpeerinfo` and `getnetworkinfo`. :param servicesflag: The services as an integer. :param servicenames: The list of decoded services names, as strings.

(servicesflag, servicenames)

Source from the content-addressed store, hash-verified

29
30
31def assert_net_servicesnames(servicesflag, servicenames):
32 """Utility that checks if all flags are correctly decoded in
33 `getpeerinfo` and `getnetworkinfo`.
34
35 :param servicesflag: The services as an integer.
36 :param servicenames: The list of decoded services names, as strings.
37 """
38 servicesflag_generated = 0
39 for servicename in servicenames:
40 servicesflag_generated |= getattr(test_framework.messages, 'NODE_' + servicename)
41 assert servicesflag_generated == servicesflag
42
43
44class NetTest(BitcoinTestFramework):

Callers 2

test_getpeerinfoMethod · 0.85
test_getnetworkinfoMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_getpeerinfoMethod · 0.68
test_getnetworkinfoMethod · 0.68