From 2ff3e55f089075122835f136fd85f2e02efd6254 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Mon, 29 Jul 2024 17:58:43 -0700 Subject: [PATCH] plugin: Removing `category`, `description` and `long_description` from plugin_command struct Changelog-None. --- plugins/autoclean.c | 6 ------ plugins/bcli.c | 17 ----------------- plugins/bkpr/bookkeeper.c | 22 ---------------------- plugins/chanbackup.c | 8 -------- plugins/commando.c | 12 ------------ plugins/funder.c | 5 ----- plugins/keysend.c | 5 +---- plugins/libplugin.c | 4 ---- plugins/libplugin.h | 3 --- plugins/offers.c | 22 ++-------------------- plugins/pay.c | 9 --------- plugins/renepay/main.c | 6 ------ plugins/spender/fundchannel.c | 6 ------ plugins/spender/multifundchannel.c | 9 --------- plugins/spender/multiwithdraw.c | 4 ---- plugins/sql.c | 10 ++-------- plugins/topology.c | 18 ------------------ plugins/txprepare.c | 15 --------------- tests/plugins/test_libplugin.c | 14 -------------- 19 files changed, 5 insertions(+), 190 deletions(-) diff --git a/plugins/autoclean.c b/plugins/autoclean.c index c3febc05a50a..531830cf0118 100644 --- a/plugins/autoclean.c +++ b/plugins/autoclean.c @@ -793,15 +793,9 @@ static bool u64_jsonfmt_unless_zero(struct plugin *plugin, static const struct plugin_command commands[] = { { "autoclean-status", - "utility", - "Show status of autocleaning", - "Takes optional {subsystem}", json_autoclean_status, }, { "autoclean-once", - "utility", - "Perform a single run of autocleaning on one subsystem", - "Requires {subsystem} and {age}", json_autoclean_once, }, }; diff --git a/plugins/bcli.c b/plugins/bcli.c index bc929f4356c6..27cfb6a4f61a 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -1119,39 +1119,22 @@ static const char *init(struct plugin *p, const char *buffer UNUSED, static const struct plugin_command commands[] = { { "getrawblockbyheight", - "bitcoin", - "Get the bitcoin block at a given height", - "", getrawblockbyheight }, { "getchaininfo", - "bitcoin", - "Get the chain id, the header count, the block count," - " and whether this is IBD.", - "", getchaininfo }, { "estimatefees", - "bitcoin", - "Get the urgent, normal and slow Bitcoin feerates as" - " sat/kVB.", - "", estimatefees }, { "sendrawtransaction", - "bitcoin", - "Send a raw transaction to the Bitcoin network.", - "", sendrawtransaction }, { "getutxout", - "bitcoin", - "Get information about an output, identified by a {txid} an a {vout}", - "", getutxout }, }; diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index 2151032a5685..0bb4b9cc3897 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -1752,48 +1752,26 @@ const struct plugin_notification notifs[] = { static const struct plugin_command commands[] = { { "bkpr-listbalances", - "bookkeeping", - "List current account balances", - "List of current accounts and their balances", json_list_balances }, { "bkpr-listaccountevents", - "bookkeeping", - "List all events for an {account}", - "List all events for an {account} (or all accounts, if" - " no account specified) in {format}. Sorted by timestamp", json_list_account_events }, { "bkpr-inspect", - "utilities", - "See the current on-chain graph of an {account}", - "Prints out the on-chain footprint of a given {account}.", json_inspect }, { "bkpr-listincome", - "bookkeeping", - "List all income impacting events", - "List all events for this node that impacted income", json_list_income }, { "bkpr-dumpincomecsv", - "bookkeeping", - "Print out all the income events to a csv file in " - " {csv_format", - "Dump income statment data to {csv_file} in {csv_format}." - " Optionally, {consolidate_fee}s into single entries" - " (default: true)", json_dump_income }, { "bkpr-channelsapy", - "bookkeeping", - "Stats on channel fund usage", - "Print out stats on chanenl fund usage", json_channel_apy }, }; diff --git a/plugins/chanbackup.c b/plugins/chanbackup.c index d7b2db10d73f..cd094e41e709 100644 --- a/plugins/chanbackup.c +++ b/plugins/chanbackup.c @@ -815,18 +815,10 @@ static const struct plugin_hook hooks[] = { static const struct plugin_command commands[] = { { "emergencyrecover", - "recovery", - "Populates the DB with stub channels", - "returns stub channel-id's on completion", json_emergencyrecover, }, { "restorefrompeer", - "recovery", - "Checks if i have got a backup from a peer, and if so, will stub " - "those channels in the database and if is successful, will return " - "list of channels that have been successfully stubbed", - "return channel-id's on completion", json_restorefrompeer, }, }; diff --git a/plugins/commando.c b/plugins/commando.c index 37ef7965bf1f..0f20ad92732f 100644 --- a/plugins/commando.c +++ b/plugins/commando.c @@ -801,33 +801,21 @@ static const char *init(struct plugin *p, static const struct plugin_command commands[] = { { "commando", - "utility", - "Send a commando message to a direct peer, wait for response", - "Sends {peer_id} {method} with optional {params} and {rune}", json_commando, }, { "commando-rune", - "utility", - "Create or restrict a rune", - "Takes an optional {rune} with optional {restrictions} and returns {rune}", json_commando_rune, "v23.08", "v25.02", }, { "commando-listrunes", - "utility", - "List runes we have created earlier", - "Takes an optional {rune} and returns list of {rune}", json_commando_listrunes, "v23.08", "v25.02", }, { "commando-blacklist", - "utility", - "Blacklist a rune or range of runes by unique id", - "Takes an optional {start} and an optional {end} and returns {blacklist} array containing {start}, {end}", json_commando_blacklist, "v23.08", "v25.02", diff --git a/plugins/funder.c b/plugins/funder.c index 077b3aa9aa8b..eb292bd6dcf3 100644 --- a/plugins/funder.c +++ b/plugins/funder.c @@ -1432,11 +1432,6 @@ json_funderupdate(struct command *cmd, static const struct plugin_command commands[] = { { "funderupdate", - "liquidity", - "Configuration for dual-funding settings.", - "Update current settings. Modifies how node reacts to" - " incoming channel open requests. Responds with list" - " of current configs.", json_funderupdate }, }; diff --git a/plugins/keysend.c b/plugins/keysend.c index ba3dee8628f3..486a203b6fba 100644 --- a/plugins/keysend.c +++ b/plugins/keysend.c @@ -307,10 +307,7 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf, static const struct plugin_command commands[] = { { "keysend", - "payment", - "Send a payment without an invoice to a node", - "Send an unsolicited payment of {amount} to {destination}, by providing the recipient the necessary information to claim the payment", - json_keysend + json_keysend }, }; diff --git a/plugins/libplugin.c b/plugins/libplugin.c index 4f83dfc2d85c..fffcbe5aaffd 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -1088,10 +1088,6 @@ handle_getmanifest(struct command *getmanifest_cmd, json_add_string(params, "name", p->commands[i].name); json_add_string(params, "usage", strmap_get(&p->usagemap, p->commands[i].name)); - json_add_string(params, "description", p->commands[i].description); - if (p->commands[i].long_description) - json_add_string(params, "long_description", - p->commands[i].long_description); json_add_deprecated(params, "deprecated", p->commands[i].depr_start, p->commands[i].depr_end); json_object_end(params); diff --git a/plugins/libplugin.h b/plugins/libplugin.h index 9b2a5c748a62..130127d2b458 100644 --- a/plugins/libplugin.h +++ b/plugins/libplugin.h @@ -62,9 +62,6 @@ struct command { /* Create an array of these, one for each command you support. */ struct plugin_command { const char *name; - const char *category; - const char *description; - const char *long_description; struct command_result *(*handle)(struct command *cmd, const char *buf, const jsmntok_t *params); diff --git a/plugins/offers.c b/plugins/offers.c index 98b807bcfba0..31acecab7d77 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -1396,44 +1396,26 @@ static const char *init(struct plugin *p, static const struct plugin_command commands[] = { { "offer", - "payment", - "Create an offer to accept money", - "Create an offer for invoices of {amount} with {description}, optional {issuer}, internal {label}, {quantity_min}, {quantity_max}, {absolute_expiry}, {recurrence}, {recurrence_base}, {recurrence_paywindow}, {recurrence_limit} and {single_use}", - json_offer + json_offer }, { "invoicerequest", - "payment", - "Create an invoice_request to send money", - "Create an invoice_request to pay invoices of {amount} with {description}, optional {issuer}, internal {label}, and {absolute_expiry}", - json_invoicerequest + json_invoicerequest }, { "decode", - "utility", - "Decode {string} message, returning {type} and information.", - NULL, json_decode, }, { "fetchinvoice", - "payment", - "Request remote node for an invoice for this {offer}, with {amount}, {quanitity}, {recurrence_counter}, {recurrence_start} and {recurrence_label} iff required.", - NULL, json_fetchinvoice, }, { "sendinvoice", - "payment", - "Request remote node for to pay this {invreq}, with {label}, optional {amount_msat}, and {timeout} (default 90 seconds).", - NULL, json_sendinvoice, }, { "dev-rawrequest", - "util", - "Send {invreq} to {nodeid}, wait {timeout} (60 seconds by default)", - NULL, json_dev_rawrequest, .dev_only = true, }, diff --git a/plugins/pay.c b/plugins/pay.c index 8889a2808b3f..3a33f3d88c6f 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1508,22 +1508,13 @@ static struct command_result *json_pay(struct command *cmd, static const struct plugin_command commands[] = { { "paystatus", - "payment", - "Detail status of attempts to pay {bolt11}, or all", - "Covers both old payments and current ones.", json_paystatus }, { "listpays", - "payment", - "List result of payment {bolt11} or {payment_hash}, or all", - "Covers old payments (failed and succeeded) and current ones.", json_listpays }, { "pay", - "payment", - "Send payment specified by {bolt11}", - "Attempt to pay the {bolt11} invoice.", json_pay }, }; diff --git a/plugins/renepay/main.c b/plugins/renepay/main.c index a571695d150f..2aa13dace0c1 100644 --- a/plugins/renepay/main.c +++ b/plugins/renepay/main.c @@ -382,16 +382,10 @@ static struct command_result *json_pay(struct command *cmd, const char *buf, static const struct plugin_command commands[] = { { "renepaystatus", - "payment", - "Detail status of attempts to pay {bolt11}, or all", - "Covers both old payments and current ones.", json_paystatus }, { "renepay", - "payment", - "Send payment specified by {invstring}", - "Attempt to pay an invoice.", json_pay }, }; diff --git a/plugins/spender/fundchannel.c b/plugins/spender/fundchannel.c index bc8542c786ac..e797492b61f5 100644 --- a/plugins/spender/fundchannel.c +++ b/plugins/spender/fundchannel.c @@ -11,12 +11,6 @@ json_fundchannel(struct command *cmd, const struct plugin_command fundchannel_commands[] = { { "fundchannel", - "channels", - "Fund channel with {id} using {amount} (or 'all'), at optional {feerate}. " - "Only use outputs that have {minconf} confirmations.", - "Initiaties a channel open with node 'id'. Must " - "be connected to the node and have enough funds available at the requested minimum confirmation " - "depth (minconf)", json_fundchannel } }; diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index 52f6ddb3dc31..145d74240ed7 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -2018,15 +2018,6 @@ json_multifundchannel(struct command *cmd, const struct plugin_command multifundchannel_commands[] = { { "multifundchannel", - "channels", - "Fund channels to {destinations}, which is an array of " - "objects containing peer {id}, {amount}, and optional " - "{announce} and {push_msat}. " - "A single transaction will be used to fund all the " - "channels. " - "Use {feerate} for the transaction, select outputs that are " - "buried {minconf} blocks deep, or specify a set of {utxos}.", - "Fund multiple channels at once.", json_multifundchannel } }; diff --git a/plugins/spender/multiwithdraw.c b/plugins/spender/multiwithdraw.c index 9142ef36f123..04d35383f43d 100644 --- a/plugins/spender/multiwithdraw.c +++ b/plugins/spender/multiwithdraw.c @@ -24,10 +24,6 @@ json_multiwithdraw(struct command *cmd, const struct plugin_command multiwithdraw_commands[] = { { "multiwithdraw", - "bitcoin", - "Send to multiple {outputs} via a single Bitcoin transaction.", - "Send to multiple {outputs} at optiona {feerate}, spending " - "coins at least {minconf} depth, or the specified {utxos}.", &json_multiwithdraw, false } diff --git a/plugins/sql.c b/plugins/sql.c index b4f55dfc51a9..dd5d722aff17 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -1545,17 +1545,11 @@ static const char *init(struct plugin *plugin, } static const struct plugin_command commands[] = { { - "sql", - "misc", - "Run {query} and return result", - "This is the greatest plugin command ever!", - json_sql, + "sql", + json_sql, }, { "listsqlschemas", - "misc", - "Display schemas for internal sql tables, or just {table}", - "This is the greatest plugin command ever!", json_listsqlschemas, }, }; diff --git a/plugins/topology.c b/plugins/topology.c index ecd97443e9ea..d2368bdbf086 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -728,36 +728,18 @@ static const char *init(struct plugin *p, static const struct plugin_command commands[] = { { "getroute", - "channels", - "Primitive route command", - "Show route to {id} for {msatoshi}, using {riskfactor} and optional {cltv} (default 9). " - "If specified search from {fromid} otherwise use this node as source. " - "Randomize the route with up to {fuzzpercent} (ignored)). " - "{exclude} an array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) " - "or node-id from consideration. " - "Set the {maxhops} the route can take (default 20).", json_getroute, }, { "listchannels", - "channels", - "List all known channels in the network", - "Show channels for {short_channel_id}, {source} or {destination} " - "(or all known channels, if not specified)", json_listchannels, }, { "listnodes", - "network", - "List all known nodes in the network", - "Show node {id} (or all known nods, if not specified)", json_listnodes, }, { "listincoming", - "network", - "List the channels incoming from our direct peers", - "Used by invoice code to select peers for routehints", json_listincoming, }, }; diff --git a/plugins/txprepare.c b/plugins/txprepare.c index d3728d4357f6..360f4277c4ef 100644 --- a/plugins/txprepare.c +++ b/plugins/txprepare.c @@ -633,37 +633,22 @@ static struct command_result *json_upgradewallet(struct command *cmd, static const struct plugin_command commands[] = { { "txprepare", - "bitcoin", - "Create a transaction, with option to spend in future (either txsend and txdiscard)", - "Create an unsigned transaction paying {outputs} with optional {feerate}, {minconf} and {utxos}", json_txprepare }, { "txdiscard", - "bitcoin", - "Discard a transaction created by txprepare", - "Discard a transcation by {txid}", json_txdiscard }, { "txsend", - "bitcoin", - "Send a transaction created by txprepare", - "Send a transacation by {txid}", json_txsend }, { "withdraw", - "bitcoin", - "Send funds to {destination} address", - "Send to {destination} {satoshi} (or 'all') at optional {feerate} using utxos from {minconf} or {utxos}.", json_withdraw }, { "upgradewallet", - "bitcoin", - "Spend p2sh wrapped outputs into a native segwit output", - "Send all p2sh-wrapped outputs to a bech32 native segwit address", json_upgradewallet }, }; diff --git a/tests/plugins/test_libplugin.c b/tests/plugins/test_libplugin.c index d95f43a5e8fb..6a2580ef63cf 100644 --- a/tests/plugins/test_libplugin.c +++ b/tests/plugins/test_libplugin.c @@ -233,34 +233,20 @@ static const char *init(struct plugin *p, static const struct plugin_command commands[] = { { "helloworld", - "utils", - "Say hello to the world.", - "Returns 'hello world' by default, 'hello {name}' if the name" - " option was set, and 'hello {name}' if the name parameter " - "was passed (takes over the option)", json_helloworld, }, { "testrpc", - "utils", - "Makes a simple getinfo call, to test rpc socket.", - "", json_testrpc, }, { "testrpc-deprecated", - "utils", - "Makes a simple getinfo call, to test rpc socket.", - "", json_testrpc, "v0.9.1", CLN_NEXT_VERSION, }, { "checkthis", - "utils", - "Passes arg to listdatastore", - "", json_checkthis, }, };