aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-01-29 18:09:46 -0500
committerRussell Yanofsky <russ@yanofsky.org>2021-01-29 18:09:46 -0500
commit6158a6d3978a18d5ac4166ca2f59056d8ef71c3d (patch)
tree13a8ad94af645984bb524c0a3e0db638b10f0430 /src/rpc/util.h
parent80e16cadd56ca73b94b01c5cd98a325fe9d89bf3 (diff)
downloadbitcoin-6158a6d3978a18d5ac4166ca2f59056d8ef71c3d.tar.xz
refactor: Replace JSONRPCRequest fHelp field with mode field
No change in behavior
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 444a013ca1..aaca887900 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -335,26 +335,12 @@ public:
using RPCMethodImpl = std::function<UniValue(const RPCHelpMan&, const JSONRPCRequest&)>;
RPCHelpMan(std::string name, std::string description, std::vector<RPCArg> args, RPCResults results, RPCExamples examples, RPCMethodImpl fun);
+ UniValue HandleRequest(const JSONRPCRequest& request);
std::string ToString() const;
/** Append the named args that need to be converted from string to another JSON type */
void AppendArgMap(UniValue& arr) const;
- UniValue HandleRequest(const JSONRPCRequest& request)
- {
- Check(request);
- return m_fun(*this, request);
- }
/** If the supplied number of args is neither too small nor too high */
bool IsValidNumArgs(size_t num_args) const;
- /**
- * Check if the given request is valid according to this command or if
- * the user is asking for help information, and throw help when appropriate.
- */
- inline void Check(const JSONRPCRequest& request) const {
- if (request.fHelp || !IsValidNumArgs(request.params.size())) {
- throw std::runtime_error(ToString());
- }
- }
-
std::vector<std::string> GetArgNames() const;
const std::string m_name;