Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2004 rpc man #13

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/qt/test/rpcnestedtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
#include <QDir>
#include <QtGlobal>

static UniValue rpcNestedTest_rpc(const JSONRPCRequest& request)
static RPCMan rpcNestedTest_rpc()
{
return RPCMan{"rpcNestedTest", "test", {}, {}, RPCExamples{""}, [](const RPCMan& self, const JSONRPCRequest& request) -> UniValue {
if (request.fHelp) {
return "help message";
}
return request.params.write(0, 0);
}};
}

static const CRPCCommand vRPCCommands[] =
Expand Down
4 changes: 2 additions & 2 deletions src/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static bool rest_block_notxdetails(HTTPRequest* req, const std::string& strURIPa
}

// A bit of a hack - dependency on a function defined in rpc/blockchain.cpp
UniValue getblockchaininfo(const JSONRPCRequest& request);
RPCMan getblockchaininfo();

static bool rest_chaininfo(HTTPRequest* req, const std::string& strURIPart)
{
Expand All @@ -299,7 +299,7 @@ static bool rest_chaininfo(HTTPRequest* req, const std::string& strURIPart)
case RetFormat::JSON: {
JSONRPCRequest jsonRequest;
jsonRequest.params = UniValue(UniValue::VARR);
UniValue chainInfoObject = getblockchaininfo(jsonRequest);
UniValue chainInfoObject = CALL_RPC_METHOD(getblockchaininfo, jsonRequest);
std::string strJSON = chainInfoObject.write() + "\n";
req->WriteHeader("Content-Type", "application/json");
req->WriteReply(HTTP_OK, strJSON);
Expand Down
Loading