| 28 | }; |
| 29 | |
| 30 | UniValue 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 | |
| 51 | BOOST_FIXTURE_TEST_SUITE(rpc_tests, RPCTestingSetup) |
nothing calls this directly
no test coverage detected