MCPcopy Create free account
hub / github.com/ElementsProject/elements / CallRPC

Method CallRPC

src/test/rpc_tests.cpp:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28};
29
30UniValue RPCTestingSetup::CallRPC(std::string args)
31{
32 std::vector<std::string> vArgs;
33 boost::split(vArgs, args, boost::is_any_of(" \t"));
34 std::string strMethod = vArgs[0];
35 vArgs.erase(vArgs.begin());
36 JSONRPCRequest request;
37 request.context = &m_node;
38 request.strMethod = strMethod;
39 request.params = RPCConvertValues(strMethod, vArgs);
40 if (RPCIsInWarmup(nullptr)) SetRPCWarmupFinished();
41 try {
42 UniValue result = tableRPC.execute(request);
43 return result;
44 }
45 catch (const UniValue& objError) {
46 throw std::runtime_error(find_value(objError, "message").get_str());
47 }
48}
49
50
51BOOST_FIXTURE_TEST_SUITE(rpc_tests, RPCTestingSetup)

Callers

nothing calls this directly

Calls 6

RPCConvertValuesFunction · 0.85
RPCIsInWarmupFunction · 0.85
SetRPCWarmupFinishedFunction · 0.85
eraseMethod · 0.45
beginMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected