Skip to content

Commit 2a8cc35

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
plugins: Updated Makefile for SQL plugin
1 parent 2d703fc commit 2a8cc35

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

contrib/msggen/msggen/utils/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def combine_schemas(schema_dir: Path, dest: Path):
182182
# Parse methods
183183
files = sorted(list(schema_dir.iterdir()))
184184
for f in files:
185-
# Ignore lightning-sql.json because it will be auto generated by sql plugin and lightning-sql-template.json
186-
if not f.name.endswith(".json") or f.name == "lightning-sql.json":
185+
# Ignore sql.json because it will be auto generated by sql plugin and sql-template.json
186+
if not f.name.endswith(".json") or f.name == "sql.json":
187187
continue
188188
methods[f.name] = json.load(f.open())
189189

@@ -222,7 +222,7 @@ def check_missing():
222222
"""
223223
schema = get_schema_bundle()
224224
command_names = set(
225-
full_name.replace("lightning-", "").replace(".json", "") for full_name in schema["methods"].keys()
225+
full_name.replace(".json", "") for full_name in schema["methods"].keys()
226226
)
227227
lower_method_names = set(name.lower() for name in grpc_method_names)
228228
return command_names - lower_method_names
@@ -232,7 +232,7 @@ def load_jsonrpc_method(name):
232232
"""Load a method based on the file naming conventions for the JSON-RPC.
233233
"""
234234
schema = get_schema_bundle()
235-
rpc_name = f"lightning-{name.lower()}.json"
235+
rpc_name = f"{name.lower()}.json"
236236
request = CompositeField.from_js(schema["methods"][rpc_name]['request'], path=name)
237237
response = CompositeField.from_js(schema["methods"][rpc_name]['response'], path=name)
238238

plugins/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ plugins/recklessrpc: $(PLUGIN_RECKLESSRPC_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMM
252252

253253
# This covers all the low-level list RPCs which return simple arrays
254254
SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays bkpr-listaccountevents bkpr-listincome
255-
SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/lightning-$l.json)
255+
SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/$l.json)
256256
SQL_SCHEMA_PARTS := $(foreach l,$(SQL_LISTRPCS), plugins/sql-schema_$l_gen.h)
257257

258258
# RES_JSON is generated by:
@@ -261,7 +261,7 @@ SQL_SCHEMA_PARTS := $(foreach l,$(SQL_LISTRPCS), plugins/sql-schema_$l_gen.h)
261261
# (We only need [field].type, [field].name, [field].deprecated, [field].allOf, [field].items.allOf and allOf from response.properties)
262262
# 3: deleting empty objects from .response.properties
263263
# But these simple removals drop us from 100k to 18k.
264-
plugins/sql-schema_%_gen.h: doc/schemas/lightning-%.json
264+
plugins/sql-schema_%_gen.h: doc/schemas/%.json
265265
@jq 'walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties' < $< > $@
266266

267267
# Regen if these rules change!

0 commit comments

Comments
 (0)