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