remove JSON Spirit UniValue wrapper

This commit is contained in:
Jonas Schnelli
2015-05-13 21:29:19 +02:00
committed by Jack Grigg
parent 565d26737a
commit 851f58f94e
23 changed files with 255 additions and 274 deletions

View File

@@ -96,7 +96,7 @@ static bool AppInitRPC(int argc, char* argv[])
return true;
}
Object CallRPC(const string& strMethod, const Array& params)
UniValue CallRPC(const string& strMethod, const Array& params)
{
// Connect to localhost
bool fUseSSL = GetBoolArg("-rpcssl", false);
@@ -152,7 +152,7 @@ Object CallRPC(const string& strMethod, const Array& params)
throw runtime_error("no response from server");
// Parse reply
Value valReply(UniValue::VSTR);
UniValue valReply(UniValue::VSTR);
if (!valReply.read(strReply))
throw runtime_error("couldn't parse reply from server");
const Object& reply = valReply.get_obj();
@@ -180,14 +180,13 @@ int CommandLineRPC(int argc, char *argv[])
// Parameters default to strings
std::vector<std::string> strParams(&argv[2], &argv[argc]);
Array params = RPCConvertValues(strMethod, strParams);
UniValue params = RPCConvertValues(strMethod, strParams);
// Execute and handle connection failures with -rpcwait
const bool fWait = GetBoolArg("-rpcwait", false);
do {
try {
// Execute
Object reply = CallRPC(strMethod, params);
const UniValue reply = CallRPC(strMethod, params);
// Parse reply
const Value& result = find_value(reply, "result");