From 49387059efff264628cc5bcc7662590aa08ab673 Mon Sep 17 00:00:00 2001 From: Francis Mendoza Date: Mon, 3 Oct 2022 12:28:21 -0700 Subject: [PATCH] Add rpcLGR_IDX_MALFORMED error messages to ledger sequence min and max out of range conditionals (#336) --- src/rpc/RPCHelpers.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 469657cc..56981250 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -1,8 +1,6 @@ #include #include #include -#include - namespace RPC { std::optional @@ -1473,7 +1471,6 @@ parseTaker(boost::json::value const& taker) return Status{Error::rpcINVALID_PARAMS, "invalidTakerAccount"}; return *takerID; } - bool specifiesCurrentOrClosedLedger(boost::json::object const& request) { @@ -1571,7 +1568,7 @@ traverseTransactions( if (context.range.maxSequence < min.as_int64() || context.range.minSequence > min.as_int64()) return Status{ - Error::rpcINVALID_PARAMS, "ledgerSeqMinOutOfRange"}; + Error::rpcLGR_IDX_MALFORMED, "ledgerSeqMinOutOfRange"}; else minIndex = boost::json::value_to(min); } @@ -1593,7 +1590,7 @@ traverseTransactions( if (context.range.maxSequence < max.as_int64() || context.range.minSequence > max.as_int64()) return Status{ - Error::rpcINVALID_PARAMS, "ledgerSeqMaxOutOfRange"}; + Error::rpcLGR_IDX_MALFORMED, "ledgerSeqMaxOutOfRange"}; else maxIndex = boost::json::value_to(max); }