mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
rpc: Use RPCHelpMan for check-rpc-mappings linter
This commit is contained in:
parent
faf835680b
commit
fa92912b4b
7 changed files with 106 additions and 164 deletions
|
|
@ -144,8 +144,13 @@ static RPCHelpMan help()
|
|||
[&](const RPCHelpMan& self, const JSONRPCRequest& jsonRequest) -> UniValue
|
||||
{
|
||||
std::string strCommand;
|
||||
if (jsonRequest.params.size() > 0)
|
||||
if (jsonRequest.params.size() > 0) {
|
||||
strCommand = jsonRequest.params[0].get_str();
|
||||
}
|
||||
if (strCommand == "dump_all_command_conversions") {
|
||||
// Used for testing only, undocumented
|
||||
return tableRPC.dumpArgMap();
|
||||
}
|
||||
|
||||
return tableRPC.help(strCommand, jsonRequest);
|
||||
},
|
||||
|
|
@ -479,6 +484,18 @@ std::vector<std::string> CRPCTable::listCommands() const
|
|||
return commandList;
|
||||
}
|
||||
|
||||
UniValue CRPCTable::dumpArgMap() const
|
||||
{
|
||||
UniValue ret{UniValue::VARR};
|
||||
for (const auto& cmd : mapCommands) {
|
||||
for (const auto& c : cmd.second) {
|
||||
const auto help = RpcMethodFnType(c->unique_id)();
|
||||
help.AppendArgMap(ret);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
|
||||
{
|
||||
if (!timerInterface)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue