mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
@@ -76,12 +76,12 @@ AccountTxHandler::process(AccountTxHandler::Input input, Context const& ctx) con
|
||||
// if forward, start at minIndex - 1, because the SQL query is exclusive, we need to include the 0 transaction
|
||||
// index of minIndex
|
||||
if (input.forward)
|
||||
cursor = {minIndex - 1, INT32_MAX};
|
||||
cursor = {minIndex - 1, std::numeric_limits<int32_t>::max()};
|
||||
else
|
||||
cursor = {maxIndex, INT32_MAX};
|
||||
cursor = {maxIndex, std::numeric_limits<int32_t>::max()};
|
||||
}
|
||||
|
||||
static auto constexpr limitDefault = 50;
|
||||
static auto constexpr limitDefault = 200;
|
||||
auto const limit = input.limit.value_or(limitDefault);
|
||||
auto const accountID = accountFromStringStrict(input.account);
|
||||
auto const [txnsAndCursor, timeDiff] = util::timed([&]() {
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
{JS(ledger_index_max), validation::Type<int32_t>{}},
|
||||
{JS(binary), validation::Type<bool>{}},
|
||||
{JS(forward), validation::Type<bool>{}},
|
||||
{JS(limit), validation::Type<uint32_t>{}, validation::Between{1, 100}},
|
||||
{JS(limit), validation::Type<uint32_t>{}, validation::Between{1, std::numeric_limits<int32_t>::max()}},
|
||||
{JS(marker),
|
||||
validation::WithCustomError{
|
||||
validation::Type<boost::json::object>{},
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <rpc/handlers/NFTHistory.h>
|
||||
#include <util/Profiler.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace RPC {
|
||||
|
||||
// TODO: this is currently very similar to account_tx but its own copy for time
|
||||
@@ -76,7 +78,7 @@ NFTHistoryHandler::process(NFTHistoryHandler::Input input, Context const& ctx) c
|
||||
if (input.forward)
|
||||
cursor = {minIndex, 0};
|
||||
else
|
||||
cursor = {maxIndex, INT32_MAX};
|
||||
cursor = {maxIndex, std::numeric_limits<int32_t>::max()};
|
||||
}
|
||||
|
||||
static auto constexpr limitDefault = 50;
|
||||
|
||||
@@ -107,8 +107,8 @@ generateTestValuesForParametersTest()
|
||||
"invalidParams",
|
||||
"Invalid parameters."},
|
||||
AccountTxParamTestCaseBundle{
|
||||
"limitOverRange",
|
||||
R"({"account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "limit": 101})",
|
||||
"limitNotInRange",
|
||||
R"({"account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "limit": 0})",
|
||||
"invalidParams",
|
||||
"Invalid parameters."},
|
||||
AccountTxParamTestCaseBundle{
|
||||
|
||||
Reference in New Issue
Block a user