diff --git a/doc/Makefile b/doc/Makefile index 6f4cab522..ce7ea26c8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -68,7 +68,7 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-listpays.7 \ doc/lightning-listpeers.7 \ doc/lightning-listpeerchannels.7 \ - doc/lightning-listrunes.7 \ + doc/lightning-showrunes.7 \ doc/lightning-listsendpays.7 \ doc/lightning-makesecret.7 \ doc/lightning-multifundchannel.7 \ diff --git a/doc/index.rst b/doc/index.rst index 0060662f9..9adb7b063 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -96,7 +96,6 @@ Core Lightning Documentation lightning-listpays lightning-listpeerchannels lightning-listpeers - lightning-listrunes lightning-listsendpays lightning-listsqlschemas lightning-listtransactions @@ -128,6 +127,7 @@ Core Lightning Documentation lightning-setchannel lightning-setconfig lightning-setpsbtversion + lightning-showrunes lightning-signinvoice lightning-signmessage lightning-signpsbt diff --git a/doc/lightning-blacklistrune.7.md b/doc/lightning-blacklistrune.7.md index 64ba7c085..f022ba31e 100644 --- a/doc/lightning-blacklistrune.7.md +++ b/doc/lightning-blacklistrune.7.md @@ -34,7 +34,7 @@ Shahana Farooqui <> is mainly responsible. SEE ALSO -------- -lightning-commando-blacklist(7), lightning-listrunes(7) +lightning-commando-blacklist(7), lightning-showrunes(7) RESOURCES --------- diff --git a/doc/lightning-listrunes.7.md b/doc/lightning-showrunes.7.md similarity index 89% rename from doc/lightning-listrunes.7.md rename to doc/lightning-showrunes.7.md index 4de91439b..fb7ce42b8 100644 --- a/doc/lightning-listrunes.7.md +++ b/doc/lightning-showrunes.7.md @@ -1,15 +1,15 @@ -lightning-listrunes -- Command to list previously generated runes +lightning-showrunes -- Command to list previously generated runes ================================================================== SYNOPSIS -------- -**listrunes** [*rune*] +**showrunes** [*rune*] DESCRIPTION ----------- -The **listrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line. +The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line. RETURN VALUE ------------ @@ -41,7 +41,7 @@ Shahana Farooqui <> is mainly responsible. SEE ALSO -------- -lightning-commando-listrunes(7), lightning-blacklistrune(7) +lightning-commando-showrunes(7), lightning-blacklistrune(7) RESOURCES --------- diff --git a/doc/schemas/listrunes.request.json b/doc/schemas/showrunes.request.json similarity index 100% rename from doc/schemas/listrunes.request.json rename to doc/schemas/showrunes.request.json diff --git a/doc/schemas/listrunes.schema.json b/doc/schemas/showrunes.schema.json similarity index 100% rename from doc/schemas/listrunes.schema.json rename to doc/schemas/showrunes.schema.json diff --git a/lightningd/runes.c b/lightningd/runes.c index 73fb67af1..e4a2f3f5b 100644 --- a/lightningd/runes.c +++ b/lightningd/runes.c @@ -310,7 +310,7 @@ static struct command_result *json_add_rune(struct lightningd *ld, return NULL; } -static struct command_result *json_listrunes(struct command *cmd, +static struct command_result *json_showrunes(struct command *cmd, const char *buffer, const jsmntok_t *obj UNNEEDED, const jsmntok_t *params) @@ -339,13 +339,13 @@ static struct command_result *json_listrunes(struct command *cmd, return command_success(cmd, response); } -static const struct json_command listrunes_command = { - "listrunes", +static const struct json_command showrunes_command = { + "showrunes", "utility", - json_listrunes, - "List a rune or list/decode an optional {rune}." + json_showrunes, + "Show the list of runes or decode an optional {rune}." }; -AUTODATA(json_command, &listrunes_command); +AUTODATA(json_command, &showrunes_command); static struct rune_restr **readonly_restrictions(const tal_t *ctx) { diff --git a/tests/test_runes.py b/tests/test_runes.py index bb8a4829c..5f79ed372 100644 --- a/tests/test_runes.py +++ b/tests/test_runes.py @@ -208,7 +208,7 @@ def test_createrune(node_factory): params=params)['valid'] is True -def test_listrunes(node_factory): +def test_showrunes(node_factory): l1 = node_factory.get_node() rune1 = l1.rpc.createrune() assert rune1 == { @@ -216,12 +216,12 @@ def test_listrunes(node_factory): 'unique_id': '0', 'warning_unrestricted_rune': 'WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don\'t trust. Consider using the restrictions parameter to only allow access to specific rpc methods.' } - listrunes = l1.rpc.listrunes() - assert len(l1.rpc.listrunes()) == 1 + showrunes = l1.rpc.showrunes() + assert len(l1.rpc.showrunes()) == 1 l1.rpc.createrune() - listrunes = l1.rpc.listrunes() - assert len(listrunes['runes']) == 2 - assert listrunes == { + showrunes = l1.rpc.showrunes() + assert len(showrunes['runes']) == 2 + assert showrunes == { 'runes': [ { 'rune': 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==', @@ -238,11 +238,11 @@ def test_listrunes(node_factory): ] } - our_unstored_rune = l1.rpc.listrunes(rune='lI6iPwM1R9OkcRW25SH0a06PscPDinTfLFAjzSGFGE09OQ==')['runes'][0] + our_unstored_rune = l1.rpc.showrunes(rune='lI6iPwM1R9OkcRW25SH0a06PscPDinTfLFAjzSGFGE09OQ==')['runes'][0] assert our_unstored_rune['unique_id'] == '9' assert our_unstored_rune['stored'] is False - not_our_rune = l1.rpc.listrunes(rune='oNJAqigqDrHBGzsm7gV3z87oGpzq-KqFlOxx2O9iEQk9MA==')['runes'][0] + not_our_rune = l1.rpc.showrunes(rune='oNJAqigqDrHBGzsm7gV3z87oGpzq-KqFlOxx2O9iEQk9MA==')['runes'][0] assert not_our_rune['stored'] is False assert not_our_rune['our_rune'] is False @@ -320,7 +320,7 @@ def test_blacklistrune(node_factory): assert blacklist == {'blacklist': [{'start': 0, 'end': 6}, {'start': 9, 'end': 9}]} - blacklisted_rune = l1.rpc.listrunes(rune='geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==')['runes'][0]['blacklisted'] + blacklisted_rune = l1.rpc.showrunes(rune='geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==')['runes'][0]['blacklisted'] assert blacklisted_rune is True