Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
const int ID_NETWORKINFO = 0; | const int ID_NETWORKINFO = 0; | ||||
const int ID_BLOCKCHAININFO = 1; | const int ID_BLOCKCHAININFO = 1; | ||||
const int ID_WALLETINFO = 2; | const int ID_WALLETINFO = 2; | ||||
/** Create a simulated `getinfo` request. */ | /** Create a simulated `getinfo` request. */ | ||||
UniValue PrepareRequest(const std::string &method, | UniValue PrepareRequest(const std::string &method, | ||||
const std::vector<std::string> &args) override { | const std::vector<std::string> &args) override { | ||||
if (!args.empty()) { | |||||
throw std::runtime_error("-getinfo takes no arguments"); | |||||
} | |||||
UniValue result(UniValue::VARR); | UniValue result(UniValue::VARR); | ||||
result.push_back( | result.push_back( | ||||
JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO)); | JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO)); | ||||
result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, | result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, | ||||
ID_BLOCKCHAININFO)); | ID_BLOCKCHAININFO)); | ||||
result.push_back( | result.push_back( | ||||
JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO)); | JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO)); | ||||
return result; | return result; | ||||
▲ Show 20 Lines • Show All 337 Lines • Show Last 20 Lines |