rpc: identify JSON-RPC 2.0 requests

This commit is contained in:
Matthew Zipkin
2023-07-07 14:31:18 -04:00
parent a64a2b77e0
commit 2ca1460ae3
3 changed files with 33 additions and 6 deletions

View File

@@ -11,6 +11,11 @@
#include <univalue.h>
enum class JSONRPCVersion {
V1_LEGACY,
V2
};
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);
UniValue JSONRPCReplyObj(UniValue result, UniValue error, UniValue id);
UniValue JSONRPCError(int code, const std::string& message);
@@ -35,6 +40,7 @@ public:
std::string authUser;
std::string peerAddr;
std::any context;
JSONRPCVersion m_json_version = JSONRPCVersion::V1_LEGACY;
void parse(const UniValue& valRequest);
};