| 66 | } |
| 67 | |
| 68 | UniValue RPCTestingSetup::CallRPC(std::string args) |
| 69 | { |
| 70 | std::vector<std::string> vArgs{SplitString(args, ' ')}; |
| 71 | std::string strMethod = vArgs[0]; |
| 72 | vArgs.erase(vArgs.begin()); |
| 73 | JSONRPCRequest request; |
| 74 | request.context = &m_node; |
| 75 | request.strMethod = strMethod; |
| 76 | request.params = RPCConvertValues(strMethod, vArgs); |
| 77 | if (RPCIsInWarmup(nullptr)) SetRPCWarmupFinished(); |
| 78 | try { |
| 79 | UniValue result = tableRPC.execute(request); |
| 80 | return result; |
| 81 | } |
| 82 | catch (const UniValue& objError) { |
| 83 | throw std::runtime_error(objError.find_value("message").get_str()); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | |
| 88 | BOOST_FIXTURE_TEST_SUITE(rpc_tests, RPCTestingSetup) |
nothing calls this directly
no test coverage detected