MCPcopy Create free account
hub / github.com/ElementsProject/elements / PrepareRequest

Method PrepareRequest

src/bitcoin-cli.cpp:310–321  ·  view source on GitHub ↗

Create a simulated `getinfo` request. */

Source from the content-addressed store, hash-verified

308
309 /** Create a simulated `getinfo` request. */
310 UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
311 {
312 if (!args.empty()) {
313 throw std::runtime_error("-getinfo takes no arguments");
314 }
315 UniValue result(UniValue::VARR);
316 result.push_back(JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO));
317 result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, ID_BLOCKCHAININFO));
318 result.push_back(JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO));
319 result.push_back(JSONRPCRequestObj("getbalances", NullUniValue, ID_BALANCES));
320 return result;
321 }
322
323 /** Collect values from the batch and form a simulated `getinfo` reply. */
324 UniValue ProcessReply(const UniValue &batch_in) override

Callers 1

CallRPCFunction · 0.45

Calls 3

JSONRPCRequestObjFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected