remove CRPCCommand constructor that takes rpcfn_type function pointer

This commit is contained in:
MarcoFalke committed 2020-09-24 19:53:52 +02:00
1 parent fa19bb2cd8
commit faaf9c58e4
3 files changed
+17 -38

No files matched your search

+17 -5
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()