remove CRPCCommand constructor that takes rpcfn_type function pointer

This commit is contained in:
MarcoFalke
2020-04-01 02:55:59 +02:00
parent fa19bb2cd8
commit faaf9c58e4
3 changed files with 17 additions and 38 deletions

View File

@@ -14,14 +14,26 @@
#include <QDir>
#include <QtGlobal>
static UniValue rpcNestedTest_rpc(const JSONRPCRequest& request)
static RPCHelpMan rpcNestedTest_rpc()
{
return request.params.write(0, 0);
return RPCHelpMan{
"rpcNestedTest",
"echo the passed string(s)",
{
{"arg1", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""},
{"arg2", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""},
{"arg3", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""},
},
{},
RPCExamples{""},
[](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
return request.params.write(0, 0);
},
};
}
static const CRPCCommand vRPCCommands[] =
{
{ "test", "rpcNestedTest", &rpcNestedTest_rpc, {} },
static const CRPCCommand vRPCCommands[] = {
{"test", "rpcNestedTest", &rpcNestedTest_rpc, {"arg1", "arg2", "arg3"}},
};
void RPCNestedTests::rpcNestedTests()