From ce05849806b9adbcad48e108291d997ec880c98e Mon Sep 17 00:00:00 2001 From: Erik De Smedt Date: Fri, 23 Feb 2024 10:13:53 +0100 Subject: [PATCH] Repro: cln-plugin cannot subscribe to wildcard "*" This test reproduces a bug in the `cln-plugin`-crate. Core Lightning supports a wildcard `*` that plugins can use to subscribe to all notifications. However, `cln-plugin` does not support this case. It allows the developer to subscribe `*`. But the plug-in crashes when the first notification is received --- tests/test_cln_rs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index de97ec717223..fa4a8196248a 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -382,3 +382,15 @@ def test_grpc_decode(node_factory): string=inv.bolt11 )) print(res) + + +def test_rust_plugin_subscribe_wildcard(node_factory): + """ Creates a plugin that loads the subscribe_wildcard plugin + """ + bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-subscribe-wildcard" + l1 = node_factory.get_node(options={"plugin": bin_path}) + l2 = node_factory.get_node() + + l2.connect(l1) + + l1.daemon.wait_for_log("Received notification connect")