bug fixes in both backends. add ledger_range rpc. improve test scripts

This commit is contained in:
CJ Cobb
2021-03-05 16:46:55 -05:00
parent 7a6dfe5967
commit e3a121e571
13 changed files with 179 additions and 51 deletions

22
handlers/LedgerRange.cpp Normal file
View 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;
}