| 467 | } |
| 468 | |
| 469 | static UniValue JSONRPCExecOne(const UniValue& req) |
| 470 | { |
| 471 | UniValue rpc_result(UniValue::VOBJ); |
| 472 | |
| 473 | JSONRequest jreq; |
| 474 | try { |
| 475 | jreq.parse(req); |
| 476 | |
| 477 | UniValue result = tableRPC.execute(jreq.strMethod, jreq.params); |
| 478 | rpc_result = JSONRPCReplyObj(result, NullUniValue, jreq.id); |
| 479 | } |
| 480 | catch (const UniValue& objError) |
| 481 | { |
| 482 | rpc_result = JSONRPCReplyObj(NullUniValue, objError, jreq.id); |
| 483 | } |
| 484 | catch (const std::exception& e) |
| 485 | { |
| 486 | rpc_result = JSONRPCReplyObj(NullUniValue, |
| 487 | JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); |
| 488 | } |
| 489 | |
| 490 | return rpc_result; |
| 491 | } |
| 492 | |
| 493 | std::string JSONRPCExecBatch(const UniValue& vReq) |
| 494 | { |
no test coverage detected