3#include "etl/AmendmentBlockHandlerInterface.hpp"
4#include "etl/ExtractorInterface.hpp"
6#include "etl/Models.hpp"
7#include "etl/impl/LedgerFetcher.hpp"
8#include "util/log/Logger.hpp"
10#include <google/protobuf/repeated_ptr_field.h>
12#include <xrpl/basics/Slice.h>
13#include <xrpl/basics/base_uint.h>
14#include <xrpl/proto/org/xrpl/rpc/v1/get_ledger.pb.h>
15#include <xrpl/proto/org/xrpl/rpc/v1/ledger.pb.h>
16#include <xrpl/protocol/LedgerHeader.h>
17#include <xrpl/protocol/STTx.h>
18#include <xrpl/protocol/Serializer.h>
19#include <xrpl/protocol/TxMeta.h>
31using PBObjType = org::xrpl::rpc::v1::RawLedgerObject;
32using PBModType = PBObjType::ModificationType;
33using PBTxType = org::xrpl::rpc::v1::TransactionAndMetadata;
34using PBTxListType = google::protobuf::RepeatedPtrField<PBTxType>;
35using PBObjListType = google::protobuf::RepeatedPtrField<PBObjType>;
36using PBBookSuccessorType = org::xrpl::rpc::v1::BookSuccessor;
37using PBLedgerResponseType = org::xrpl::rpc::v1::GetLedgerResponse;
40extractModType(PBModType type);
42[[nodiscard]] model::Transaction
43extractTx(PBTxType tx, uint32_t seq);
45[[nodiscard]] std::vector<model::Transaction>
46extractTxs(PBTxListType transactions, uint32_t seq);
48[[nodiscard]] model::Object
49extractObj(PBObjType obj);
51[[nodiscard]] std::vector<model::Object>
52extractObjs(PBObjListType objects);
54[[nodiscard]] model::BookSuccessor
55extractSuccessor(PBBookSuccessorType successor);
57[[nodiscard]] std::optional<std::vector<model::BookSuccessor>>
58maybeExtractSuccessors(PBLedgerResponseType
const& data);
62 std::shared_ptr<LedgerFetcherInterface> fetcher_;
63 std::shared_ptr<AmendmentBlockHandlerInterface> amendmentBlockHandler_;
68 [[nodiscard]]
static auto
71 [[nodiscard]] std::optional<model::LedgerData>
72 guardedUnpack(std::optional<PBLedgerResponseType>&& response, uint32_t seq);
76 std::shared_ptr<LedgerFetcherInterface> fetcher,
77 std::shared_ptr<AmendmentBlockHandlerInterface> amendmentBlockHandler
79 : fetcher_(std::move(fetcher)), amendmentBlockHandler_(std::move(amendmentBlockHandler))
83 Extractor(Extractor
const&) =
delete;
84 Extractor(Extractor&&) =
delete;
86 operator=(Extractor
const&) =
delete;
88 operator=(Extractor&&) =
delete;
90 [[nodiscard]] std::optional<model::LedgerData>
93 [[nodiscard]] std::optional<model::LedgerData>
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:78
ModType
Modification type for the object.
Definition Models.hpp:90