MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_plugin_feature_remove

Function test_plugin_feature_remove

tests/test_plugin.py:2024–2042  ·  view source on GitHub ↗

Check that features registered by plugins get removed if a plugin disables itself. We set the following feature bits we don't want to include if the plugin is disabled during init. - 1 << 201 for `init` messages - 1 << 203 for `node_announcement` - 1 << 205 for bolt11 inv

(node_factory)

Source from the content-addressed store, hash-verified

2022
2023
2024def test_plugin_feature_remove(node_factory):
2025 """Check that features registered by plugins get removed if a plugin
2026 disables itself.
2027
2028 We set the following feature bits we don&#x27;t want to include if the plugin is
2029 disabled during init.
2030 - 1 << 201 for `init` messages
2031 - 1 << 203 for `node_announcement`
2032 - 1 << 205 for bolt11 invoices
2033 """
2034
2035 plugin = os.path.join(os.path.dirname(__file__), 'plugins/feature-test.py')
2036 l1 = node_factory.get_node(options={'plugin': plugin, 'disable-on-init': True})
2037
2038 # Check that we don't include the features set in getmanifest.
2039 our_feats = l1.rpc.getinfo()["our_features"]
2040 assert((int(our_feats["init"], 16) & (1 << 201)) == 0)
2041 assert((int(our_feats["node"], 16) & (1 << 203)) == 0)
2042 assert((int(our_feats["invoice"], 16) & (1 << 205)) == 0)
2043
2044
2045def test_hook_chaining(node_factory):

Callers

nothing calls this directly

Calls 3

joinMethod · 0.80
get_nodeMethod · 0.45
getinfoMethod · 0.45

Tested by

no test coverage detected