aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/protocol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/protocol.cpp')
-rw-r--r--src/rpc/protocol.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rpc/protocol.cpp b/src/rpc/protocol.cpp
index cdd2e67a69..0635b757c6 100644
--- a/src/rpc/protocol.cpp
+++ b/src/rpc/protocol.cpp
@@ -26,9 +26,9 @@
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id)
{
UniValue request(UniValue::VOBJ);
- request.push_back(Pair("method", strMethod));
- request.push_back(Pair("params", params));
- request.push_back(Pair("id", id));
+ request.pushKV("method", strMethod);
+ request.pushKV("params", params);
+ request.pushKV("id", id);
return request;
}
@@ -36,11 +36,11 @@ UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const Un
{
UniValue reply(UniValue::VOBJ);
if (!error.isNull())
- reply.push_back(Pair("result", NullUniValue));
+ reply.pushKV("result", NullUniValue);
else
- reply.push_back(Pair("result", result));
- reply.push_back(Pair("error", error));
- reply.push_back(Pair("id", id));
+ reply.pushKV("result", result);
+ reply.pushKV("error", error);
+ reply.pushKV("id", id);
return reply;
}
@@ -53,8 +53,8 @@ std::string JSONRPCReply(const UniValue& result, const UniValue& error, const Un
UniValue JSONRPCError(int code, const std::string& message)
{
UniValue error(UniValue::VOBJ);
- error.push_back(Pair("code", code));
- error.push_back(Pair("message", message));
+ error.pushKV("code", code);
+ error.pushKV("message", message);
return error;
}