xrpld
Loading...
Searching...
No Matches
tx/transactors/system/Batch.h
1#pragma once
2
3#include <xrpl/basics/Log.h>
4#include <xrpl/protocol/Indexes.h>
5#include <xrpl/tx/Transactor.h>
6
7namespace xrpl {
8
9class Batch : public Transactor
10{
11public:
13
14 explicit Batch(ApplyContext& ctx) : Transactor(ctx)
15 {
16 }
17
18 static XRPAmount
19 calculateBaseFee(ReadView const& view, STTx const& tx);
20
21 static std::uint32_t
23
24 static NotTEC
25 preflight(PreflightContext const& ctx);
26
27 static NotTEC
29
30 static NotTEC
31 checkSign(PreclaimContext const& ctx);
32
33 TER
34 doApply() override;
35
36 void
37 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
38
39 [[nodiscard]] bool
41 STTx const& tx,
42 TER result,
43 XRPAmount fee,
44 ReadView const& view,
45 beast::Journal const& j) override;
46
47 static constexpr auto kDisabledTxTypes = std::to_array<TxType>({
48 ttVAULT_CREATE,
49 ttVAULT_SET,
50 ttVAULT_DELETE,
51 ttVAULT_DEPOSIT,
52 ttVAULT_WITHDRAW,
53 ttVAULT_CLAWBACK,
54 ttLOAN_BROKER_SET,
55 ttLOAN_BROKER_DELETE,
56 ttLOAN_BROKER_COVER_DEPOSIT,
57 ttLOAN_BROKER_COVER_WITHDRAW,
58 ttLOAN_BROKER_COVER_CLAWBACK,
59 ttLOAN_SET,
60 ttLOAN_DELETE,
61 ttLOAN_MANAGE,
62 ttLOAN_PAY,
63 });
64};
65
66} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
State information when applying a tx.
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
Definition Batch.cpp:520
Batch(ApplyContext &ctx)
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Calculates the total base fee for a batch transaction.
Definition Batch.cpp:53
static NotTEC preflight(PreflightContext const &ctx)
Performs preflight validation checks for a Batch transaction.
Definition Batch.cpp:203
static NotTEC checkSign(PreclaimContext const &ctx)
Checks the validity of signatures for a batch transaction.
Definition Batch.cpp:492
TER doApply() override
Applies the outer batch transaction.
Definition Batch.cpp:514
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
Definition Batch.cpp:526
static constexpr auto kConsequencesFactory
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
Definition Batch.cpp:164
static constexpr auto kDisabledTxTypes
static NotTEC preflightSigValidated(PreflightContext const &ctx)
Definition Batch.cpp:385
A view into a ledger.
Definition ReadView.h:31
std::shared_ptr< STLedgerEntry const > const & const_ref
ApplyView & view()
Definition Transactor.h:136
Transactor(Transactor const &)=delete
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TERSubset< CanCvtToNotTEC > NotTEC
Definition TER.h:594
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:554
TERSubset< CanCvtToTER > TER
Definition TER.h:634
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:61
State information when preflighting a tx.
Definition Transactor.h:18