Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/server.h
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | CRPCCommand(std::string _category, std::string name_in, RpcMethodFnType _fn, | ||||
std::vector<std::string> args_in) | std::vector<std::string> args_in) | ||||
: CRPCCommand( | : CRPCCommand( | ||||
_category, _fn().m_name, | _category, _fn().m_name, | ||||
[_fn](Config &config, const JSONRPCRequest &request, | [_fn](Config &config, const JSONRPCRequest &request, | ||||
UniValue &result, bool) { | UniValue &result, bool) { | ||||
result = _fn().HandleRequest(config, request); | result = _fn().HandleRequest(config, request); | ||||
return true; | return true; | ||||
}, | }, | ||||
_fn().GetArgNames(), intptr_t(_fn)) {} | _fn().GetArgNames(), intptr_t(_fn)) { | ||||
CHECK_NONFATAL(_fn().m_name == name_in); | |||||
CHECK_NONFATAL(_fn().GetArgNames() == args_in); | |||||
} | |||||
//! Simplified constructor taking plain rpcfn_type function pointer. | //! Simplified constructor taking plain rpcfn_type function pointer. | ||||
CRPCCommand(const char *_category, const char *_name, rpcfn_type _fn, | CRPCCommand(const char *_category, const char *_name, rpcfn_type _fn, | ||||
std::initializer_list<const char *> _args) | std::initializer_list<const char *> _args) | ||||
: CRPCCommand( | : CRPCCommand( | ||||
_category, _name, | _category, _name, | ||||
[_fn](Config &config, const JSONRPCRequest &request, | [_fn](Config &config, const JSONRPCRequest &request, | ||||
UniValue &result, bool) { | UniValue &result, bool) { | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |