From 8a0ee5f56ef917c0569615654952daa5f7773dc0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 30 Jan 2023 16:54:17 +1030 Subject: [PATCH] plugins/sql: add listpeerchannels support. Signed-off-by: Rusty Russell --- plugins/Makefile | 2 +- tests/test_plugin.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Makefile b/plugins/Makefile index b1a4e8363..6d92bb880 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -205,7 +205,7 @@ plugins/fetchinvoice: $(PLUGIN_FETCHINVOICE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_CO plugins/funder: bitcoin/psbt.o common/psbt_open.o $(PLUGIN_FUNDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) # This covers all the low-level list RPCs which return simple arrays -SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listtransactions listsendpays +SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listtransactions listsendpays SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/$l.schema.json) # We squeeze: # descriptions (we don't need) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index d1790e002..b995b3f2e 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -3302,6 +3302,9 @@ def test_sql(node_factory, bitcoind): ret = l3.rpc.sql("SELECT * FROM peers;") assert len(only_one(ret['rows'])) == 4 + ret = l3.rpc.sql("SELECT * FROM peerchannels;") + assert len(only_one(ret['rows'])) == 57 + l3.rpc.offer(1, 'desc') ret = l3.rpc.sql("SELECT * FROM offers;") assert len(only_one(ret['rows'])) == 6