| 357 | } |
| 358 | |
| 359 | static UniValue JSONRPCExecOne(JSONRPCRequest jreq, const UniValue& req) |
| 360 | { |
| 361 | UniValue rpc_result(UniValue::VOBJ); |
| 362 | |
| 363 | try { |
| 364 | jreq.parse(req); |
| 365 | |
| 366 | UniValue result = tableRPC.execute(jreq); |
| 367 | rpc_result = JSONRPCReplyObj(result, NullUniValue, jreq.id); |
| 368 | } |
| 369 | catch (const UniValue& objError) |
| 370 | { |
| 371 | rpc_result = JSONRPCReplyObj(NullUniValue, objError, jreq.id); |
| 372 | } |
| 373 | catch (const std::exception& e) |
| 374 | { |
| 375 | rpc_result = JSONRPCReplyObj(NullUniValue, |
| 376 | JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); |
| 377 | } |
| 378 | |
| 379 | return rpc_result; |
| 380 | } |
| 381 | |
| 382 | std::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq) |
| 383 | { |
no test coverage detected