aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-01-10 00:00:57 +0700
committerMarcoFalke <falke.marco@gmail.com>2020-02-25 22:35:58 +0700
commitfa6b061fc118995eec41766519a11bc0dd1a901d (patch)
tree751a1f2e3d33f20775b6deb1da15657346b19047 /src/rpc/server.cpp
parentfa7d0503d320900e14c4d9bc016d65c7431070bb (diff)
downloadbitcoin-fa6b061fc118995eec41766519a11bc0dd1a901d.tar.xz
rpc: Auto-format RPCResult
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index b62490ed29..75baacd6f2 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -137,7 +137,7 @@ UniValue help(const JSONRPCRequest& jsonRequest)
{"command", RPCArg::Type::STR, /* default */ "all commands", "The command to get help on"},
},
RPCResult{
- "\"text\" (string) The help text\n"
+ RPCResult::Type::STR, "", "The help text"
},
RPCExamples{""},
}.ToString()
@@ -180,7 +180,7 @@ static UniValue uptime(const JSONRPCRequest& jsonRequest)
"\nReturns the total uptime of the server.\n",
{},
RPCResult{
- "ttt (numeric) The number of seconds that the server has been running\n"
+ RPCResult::Type::NUM, "", "The number of seconds that the server has been running"
},
RPCExamples{
HelpExampleCli("uptime", "")
@@ -197,16 +197,18 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
"\nReturns details of the RPC server.\n",
{},
RPCResult{
- "{\n"
- " \"active_commands\" (json array) All active commands\n"
- " [\n"
- " { (json object) Information about an active command\n"
- " \"method\" (string) The name of the RPC command \n"
- " \"duration\" (numeric) The running time in microseconds\n"
- " },...\n"
- " ],\n"
- " \"logpath\" : \"xxx\" (string) The complete file path to the debug log\n"
- "}\n"
+ RPCResult::Type::OBJ, "", "",
+ {
+ {RPCResult::Type::ARR, "active_commands", "All active commands",
+ {
+ {RPCResult::Type::OBJ, "", "Information about an active command",
+ {
+ {RPCResult::Type::STR, "method", "The name of the RPC command"},
+ {RPCResult::Type::NUM, "duration", "The running time in microseconds"},
+ }},
+ }},
+ {RPCResult::Type::STR, "logpath", "The complete file path to the debug log"},
+ }
},
RPCExamples{
HelpExampleCli("getrpcinfo", "")