4#include <rpcspec/LedgerTypes.hpp>
5#include <xrpl/basics/Slice.h>
6#include <xrpl/basics/StringUtilities.h>
7#include <xrpl/basics/strHex.h>
8#include <xrpl/protocol/LedgerFormats.h>
9#include <xrpl/protocol/LedgerHeader.h>
10#include <xrpl/protocol/jss.h>
17#include <unordered_set>
26 static constexpr auto const& kLedgerTypes = rpc::spec::kLedgerTypesTable;
36 std::array<std::string_view, std::size(kLedgerTypes)> res{};
37 std::ranges::transform(kLedgerTypes, std::begin(res), [](
auto const& item) {
51 constexpr auto kFilter = [](
auto const& item) {
52 return item.category == rpc::spec::LedgerCategory::DeletionBlocker;
55 constexpr auto kDeletionBlockersCount =
56 std::count_if(std::begin(kLedgerTypes), std::end(kLedgerTypes), kFilter);
57 std::array<xrpl::LedgerEntryType, kDeletionBlockersCount> res{};
58 auto it = std::begin(res);
59 std::ranges::for_each(kLedgerTypes, [&](
auto const& item) {
75inline xrpl::LedgerHeader
78 return xrpl::deserializeHeader(
data,
true);
91 "LedgerHeader {{Sequence: {}, Hash: {}, TxHash: {}, AccountHash: {}, ParentHash: {}}}",
93 xrpl::strHex(info.hash),
95 xrpl::strHex(info.accountHash),
96 strHex(info.parentHash)
A helper class that provides lists of different ledger type category.
Definition LedgerUtils.hpp:25
static constexpr auto getDeletionBlockerLedgerTypes()
Returns a list of all account deletion blocker's type as string.
Definition LedgerUtils.hpp:49
static constexpr auto getLedgerEntryTypeStrList()
Returns a list of all ledger entry type as string.
Definition LedgerUtils.hpp:34
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:56
This namespace contains various utilities.
Definition HandlerRegistry.hpp:24
std::string toString(xrpl::LedgerHeader const &info)
A helper function that converts a xrpl::LedgerHeader to a string representation.
Definition LedgerUtils.hpp:88
xrpl::LedgerHeader deserializeHeader(xrpl::Slice data)
Deserializes a xrpl::LedgerHeader from xrpl::Slice of data.
Definition LedgerUtils.hpp:76