| 417 | } |
| 418 | |
| 419 | static UniValue JSONRPCExecOne(const Config &config, RPCServer &rpcServer, |
| 420 | JSONRPCRequest jreq, const UniValue &req) { |
| 421 | UniValue rpc_result(UniValue::VOBJ); |
| 422 | |
| 423 | try { |
| 424 | jreq.parse(req); |
| 425 | |
| 426 | UniValue result = rpcServer.ExecuteCommand(config, jreq); |
| 427 | rpc_result = JSONRPCReplyObj(result, NullUniValue, jreq.id); |
| 428 | } catch (const UniValue &objError) { |
| 429 | rpc_result = JSONRPCReplyObj(NullUniValue, objError, jreq.id); |
| 430 | } catch (const std::exception &e) { |
| 431 | rpc_result = JSONRPCReplyObj( |
| 432 | NullUniValue, JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); |
| 433 | } |
| 434 | |
| 435 | return rpc_result; |
| 436 | } |
| 437 | |
| 438 | std::string JSONRPCExecBatch(const Config &config, RPCServer &rpcServer, |
| 439 | const JSONRPCRequest &jreq, const UniValue &vReq) { |
no test coverage detected