| 16 | using namespace std; |
| 17 | |
| 18 | UniValue 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 | |
| 36 | BOOST_AUTO_TEST_SUITE(rpc_tests) |
no test coverage detected