runes: Renamed listrunes to showrunes

This commit is contained in:
Shahana Farooqui 2023-07-25 09:33:33 +09:30 committed by Rusty Russell
parent a649e8b517
commit 49fdc0df99
8 changed files with 22 additions and 22 deletions

View file

@ -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 \

View file

@ -96,7 +96,6 @@ Core Lightning Documentation
lightning-listpays <lightning-listpays.7.md>
lightning-listpeerchannels <lightning-listpeerchannels.7.md>
lightning-listpeers <lightning-listpeers.7.md>
lightning-listrunes <lightning-listrunes.7.md>
lightning-listsendpays <lightning-listsendpays.7.md>
lightning-listsqlschemas <lightning-listsqlschemas.7.md>
lightning-listtransactions <lightning-listtransactions.7.md>
@ -128,6 +127,7 @@ Core Lightning Documentation
lightning-setchannel <lightning-setchannel.7.md>
lightning-setconfig <lightning-setconfig.7.md>
lightning-setpsbtversion <lightning-setpsbtversion.7.md>
lightning-showrunes <lightning-showrunes.7.md>
lightning-signinvoice <lightning-signinvoice.7.md>
lightning-signmessage <lightning-signmessage.7.md>
lightning-signpsbt <lightning-signpsbt.7.md>

View file

@ -34,7 +34,7 @@ Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible.
SEE ALSO
--------
lightning-commando-blacklist(7), lightning-listrunes(7)
lightning-commando-blacklist(7), lightning-showrunes(7)
RESOURCES
---------

View file

@ -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 <<sfarooqui@blockstream.com>> is mainly responsible.
SEE ALSO
--------
lightning-commando-listrunes(7), lightning-blacklistrune(7)
lightning-commando-showrunes(7), lightning-blacklistrune(7)
RESOURCES
---------

View file

@ -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)
{

View file

@ -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