MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / JSONRPCExecOne

Function JSONRPCExecOne

src/rpc/core/rpcserver.cpp:408–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408Object JSONRPCExecOne(const Value& req) {
409 Object rpc_result;
410
411 JSONRequest jreq;
412 try {
413 jreq.parse(req);
414
415 Value result = tableRPC.execute(jreq.strMethod, jreq.params);
416 rpc_result = JSONRPCReplyObj(result, Value::null, jreq.id);
417 } catch (Object& objError) {
418 rpc_result = JSONRPCReplyObj(Value::null, objError, jreq.id);
419 } catch (std::exception& e) {
420 rpc_result = JSONRPCReplyObj(Value::null, JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);
421 }
422
423 return rpc_result;
424}
425
426string JSONRPCExecBatch(const Array& vReq) {
427 Array ret;

Callers 1

JSONRPCExecBatchFunction · 0.85

Calls 5

JSONRPCReplyObjFunction · 0.85
JSONRPCErrorFunction · 0.85
parseMethod · 0.80
executeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected