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)
| 2022 | |
| 2023 | |
| 2024 | def 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'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 | |
| 2045 | def test_hook_chaining(node_factory): |