MCPcopy Create free account
hub / github.com/LUX-Core/lux / CallRPC

Function CallRPC

src/test/rpc_tests.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using namespace std;
17
18UniValue CallRPC(string args)
19{
20 vector<string> vArgs;
21 boost::split(vArgs, args, boost::is_any_of(" \t"));
22 string strMethod = vArgs[0];
23 vArgs.erase(vArgs.begin());
24 UniValue params = RPCConvertValues(strMethod, vArgs);
25 rpcfn_type method = tableRPC[strMethod]->actor;
26 try {
27 UniValue result = (*method)(params, false);
28 return result;
29 }
30 catch (const UniValue& objError) {
31 throw runtime_error(find_value(objError, "message").get_str());
32 }
33}
34
35
36BOOST_AUTO_TEST_SUITE(rpc_tests)

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.70
BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 4

RPCConvertValuesFunction · 0.85
get_strMethod · 0.80
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected