mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
bug fixes in both backends. add ledger_range rpc. improve test scripts
This commit is contained in:
@@ -169,7 +169,10 @@ doAccountTx(boost::json::object const& request, BackendInterface const& backend)
|
||||
cursor = {*ledgerSequence, *transactionIndex};
|
||||
}
|
||||
|
||||
constexpr uint32_t limit = 500;
|
||||
uint32_t limit = 200;
|
||||
if (request.contains("limit") and
|
||||
request.at("limit").kind() == boost::json::kind::int64)
|
||||
limit = request.at("limit").as_int64();
|
||||
boost::json::array txns;
|
||||
auto [blobs, retCursor] =
|
||||
backend.fetchAccountTransactions(*account, limit, cursor);
|
||||
|
||||
@@ -293,7 +293,7 @@ doBookOffers(
|
||||
return response;
|
||||
}
|
||||
|
||||
std::uint32_t limit = 500;
|
||||
std::uint32_t limit = 200;
|
||||
if (request.contains("limit") and
|
||||
request.at("limit").kind() == boost::json::kind::int64)
|
||||
limit = request.at("limit").as_int64();
|
||||
|
||||
@@ -70,7 +70,7 @@ doLedgerData(
|
||||
std::vector<Backend::LedgerObject>& results = page.objects;
|
||||
std::optional<ripple::uint256> const& returnedCursor = page.cursor;
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< "doUpperBound returned " << results.size() << " results";
|
||||
<< __func__ << " number of results = " << results.size();
|
||||
for (auto const& [key, object] : results)
|
||||
{
|
||||
ripple::STLedgerEntry sle{
|
||||
|
||||
22
handlers/LedgerRange.cpp
Normal file
22
handlers/LedgerRange.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <handlers/RPCHelpers.h>
|
||||
#include <reporting/BackendInterface.h>
|
||||
|
||||
boost::json::object
|
||||
doLedgerRange(
|
||||
boost::json::object const& request,
|
||||
BackendInterface const& backend)
|
||||
{
|
||||
boost::json::object response;
|
||||
|
||||
auto range = backend.fetchLedgerRange();
|
||||
if (!range)
|
||||
{
|
||||
response["error"] = "No data";
|
||||
}
|
||||
else
|
||||
{
|
||||
response["ledger_index_min"] = range->minSequence;
|
||||
response["ledger_index_max"] = range->maxSequence;
|
||||
}
|
||||
return response;
|
||||
}
|
||||
Reference in New Issue
Block a user