Refactor: Remove using namespace <xxx> from rpc/

This commit is contained in:
Karl-Johan Alm
2017-01-04 13:22:19 +09:00
parent 6996e066b5
commit f3c264e9a6
8 changed files with 151 additions and 167 deletions

View File

@@ -15,8 +15,6 @@
#include <stdint.h>
#include <fstream>
using namespace std;
/**
* JSON-RPC protocol. Bitcoin speaks version 1.0 for maximum compatibility,
* but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were
@@ -26,7 +24,7 @@ using namespace std;
* 1.2 spec: http://jsonrpc.org/historical/json-rpc-over-http.html
*/
UniValue JSONRPCRequestObj(const string& strMethod, const UniValue& params, const UniValue& id)
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id)
{
UniValue request(UniValue::VOBJ);
request.push_back(Pair("method", strMethod));
@@ -47,13 +45,13 @@ UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const Un
return reply;
}
string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id)
std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id)
{
UniValue reply = JSONRPCReplyObj(result, error, id);
return reply.write() + "\n";
}
UniValue JSONRPCError(int code, const string& message)
UniValue JSONRPCError(int code, const std::string& message)
{
UniValue error(UniValue::VOBJ);
error.push_back(Pair("code", code));