Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/util.h
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | public: | ||||
using RPCMethodImpl = std::function<UniValue( | using RPCMethodImpl = std::function<UniValue( | ||||
const RPCHelpMan &, Config &config, const JSONRPCRequest &)>; | const RPCHelpMan &, Config &config, const JSONRPCRequest &)>; | ||||
RPCHelpMan(std::string name, std::string description, | RPCHelpMan(std::string name, std::string description, | ||||
std::vector<RPCArg> args, RPCResults results, | std::vector<RPCArg> args, RPCResults results, | ||||
RPCExamples examples, RPCMethodImpl fun); | RPCExamples examples, RPCMethodImpl fun); | ||||
std::string ToString() const; | std::string ToString() const; | ||||
UniValue HandleRequest(Config &config, const JSONRPCRequest &request) { | UniValue HandleRequest(Config &config, const JSONRPCRequest &request) { | ||||
Check(request); | |||||
return m_fun(*this, config, request); | return m_fun(*this, config, request); | ||||
} | } | ||||
/** If the supplied number of args is neither too small nor too high */ | /** If the supplied number of args is neither too small nor too high */ | ||||
bool IsValidNumArgs(size_t num_args) const; | bool IsValidNumArgs(size_t num_args) const; | ||||
/** | /** | ||||
* Check if the given request is valid according to this command or if | * 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. | * the user is asking for help information, and throw help when appropriate. | ||||
*/ | */ | ||||
Show All 19 Lines |