Skip to content

Commit

Permalink
Pass zmq RPC results and examples to RPCHelpMan
Browse files Browse the repository at this point in the history
Summary: Partial backport of Core [[bitcoin/bitcoin#14987 | PR14987]]

Test Plan:
On master:
  ninja
  ./bitcoind
  ./bitcoin-cli help > RPCs
  ./getrpchelps.sh RPCs master
Then on the patched branch:
  ninja
  ./bitcoind
  ./getrpchelps.sh RPCs zmqPatched
  ./checkrpc.sh RPCs master zmqPatched zmq.diff
Verify `zmq.diff` does not exist.

Scripts:
{F4258185}
{F4258184}

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5818
  • Loading branch information
Nico Guiton committed Apr 24, 2020
1 parent 2bdc64f commit 6cc4213
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/zmq/zmqrpc.cpp
Expand Up @@ -16,23 +16,24 @@ namespace {
UniValue getzmqnotifications(const Config &config,
const JSONRPCRequest &request) {
if (request.fHelp || request.params.size() != 0) {
throw std::runtime_error(
RPCHelpMan{"getzmqnotifications",
"\nReturns information about the active ZeroMQ "
"notifications.\n",
{}}
.ToString() +
"\nResult:\n"
"[\n"
" { (json object)\n"
" \"type\": \"pubhashtx\", (string) Type of notification\n"
" \"address\": \"...\" (string) Address of the publisher\n"
" },\n"
" ...\n"
"]\n"
"\nExamples:\n" +
HelpExampleCli("getzmqnotifications", "") +
HelpExampleRpc("getzmqnotifications", ""));
throw std::runtime_error(RPCHelpMan{
"getzmqnotifications",
"\nReturns information about the active ZeroMQ "
"notifications.\n",
{},
RPCResult{
"[\n"
" { (json object)\n"
" \"type\": \"pubhashtx\", (string) Type of notification\n"
" \"address\": \"...\" (string) Address of the "
"publisher\n"
" },\n"
" ...\n"
"]\n"},
RPCExamples{HelpExampleCli("getzmqnotifications", "") +
HelpExampleRpc("getzmqnotifications", "")},
}
.ToStringWithResultsAndExamples());
}

UniValue result(UniValue::VARR);
Expand Down

0 comments on commit 6cc4213

Please sign in to comment.