mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
plugin: Add a list of notification topics registered by plugin
We will eventually start emitting and dispatching custom notifications from plugins just like we dispatch internal notifications. In order to get reasonable error messages we need to make sure that the topics plugins are asking for were correctly registered. When doing this we don't really care about whether the plugin that registered the notification is still alive or not (it might have died, but subscribers should stay up and running), so we keep a list of all topics attached to the `struct plugins` which gathers global plugin information.
This commit is contained in:
committed by
Rusty Russell
parent
29155c2fe8
commit
083b41f090
@@ -2402,3 +2402,13 @@ def test_self_disable(node_factory):
|
||||
# Also works with dynamic load attempts
|
||||
with pytest.raises(RpcError, match="Disabled via selfdisable option"):
|
||||
l1.rpc.plugin_start(p2, selfdisable=True)
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_custom_notification_topics(node_factory):
|
||||
plugin = os.path.join(
|
||||
os.path.dirname(__file__), "plugins", "custom_notifications.py"
|
||||
)
|
||||
l1 = node_factory.get_node(options={'plugin': plugin})
|
||||
l1.rpc.emit()
|
||||
l1.daemon.wait_for_log(r'Got a custom notification Hello world')
|
||||
|
||||
Reference in New Issue
Block a user