From d3e181f516767b79c31240f7eb06bd36fef608b5 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Fri, 12 Jul 2024 03:20:15 +0700 Subject: [PATCH] fix: add missing client's argument parsing for RPC commands --- src/rpc/client.cpp | 4 ++++ src/rpc/misc.cpp | 2 +- src/rpc/quorums.cpp | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index 863fbfd6d8..4adc8953b7 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -225,6 +225,10 @@ static const CRPCConvertParam vRPCConvertParams[] = { "getnodeaddresses", 0, "count"}, { "addpeeraddress", 1, "port"}, { "stop", 0, "wait" }, + { "verifychainlock", 2, "blockHeight" }, + { "verifyislock", 3, "maxHeight" }, + { "submitchainlock", 2, "blockHeight" }, + { "mnauth", 0, "nodeId" }, }; // clang-format on diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 377acc2679..479bb3227c 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -617,7 +617,7 @@ static RPCHelpMan mnauth() if (!Params().MineBlocksOnDemand()) throw std::runtime_error("mnauth for regression testing (-regtest mode) only"); - int nodeId = ParseInt64V(request.params[0], "nodeId"); + int64_t nodeId = request.params[0].get_int64(); uint256 proTxHash = ParseHashV(request.params[1], "proTxHash"); if (proTxHash.IsNull()) { throw JSONRPCError(RPC_INVALID_PARAMETER, "proTxHash invalid"); diff --git a/src/rpc/quorums.cpp b/src/rpc/quorums.cpp index ee6c990391..c0494a2d7a 100644 --- a/src/rpc/quorums.cpp +++ b/src/rpc/quorums.cpp @@ -974,7 +974,7 @@ static RPCHelpMan verifychainlock() } nBlockHeight = pIndex->nHeight; } else { - nBlockHeight = ParseInt32V(request.params[2], "blockHeight"); + nBlockHeight = request.params[2].get_int(); LOCK(cs_main); if (nBlockHeight < 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range"); @@ -1040,7 +1040,7 @@ static RPCHelpMan verifyislock() int maxHeight{-1}; if (!request.params[3].isNull()) { - maxHeight = ParseInt32V(request.params[3], "maxHeight"); + maxHeight = request.params[3].get_int(); } int signHeight; @@ -1094,7 +1094,7 @@ static RPCHelpMan submitchainlock() { const uint256 nBlockHash(ParseHashV(request.params[0], "blockHash")); - const int nBlockHeight = ParseInt32V(request.params[2], "blockHeight"); + const int nBlockHeight = request.params[2].get_int(); if (nBlockHeight <= 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, "invalid block height"); }