MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CallRPC

Method CallRPC

src/test/rpc_tests.cpp:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68UniValue 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
88BOOST_FIXTURE_TEST_SUITE(rpc_tests, RPCTestingSetup)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected