xrpld
Loading...
Searching...
No Matches
tx/transactors/lending/LoanSet.h
1#pragma once
2
3#include <xrpl/ledger/helpers/LendingHelpers.h>
4#include <xrpl/tx/Transactor.h>
5
6namespace xrpl {
7
8class LoanSet : public Transactor
9{
10public:
12
13 explicit LoanSet(ApplyContext& ctx) : Transactor(ctx)
14 {
15 }
16
17 static bool
19
20 static std::uint32_t
22
23 static NotTEC
24 preflight(PreflightContext const& ctx);
25
26 static NotTEC
27 checkSign(PreclaimContext const& ctx);
28
29 static XRPAmount
30 calculateBaseFee(ReadView const& view, STTx const& tx);
31
34
35 static TER
36 preclaim(PreclaimContext const& ctx);
37
38 TER
39 doApply() override;
40
41 void
42 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
43
44 [[nodiscard]] bool
46 STTx const& tx,
47 TER result,
48 XRPAmount fee,
49 ReadView const& view,
50 beast::Journal const& j) override;
51
52public:
53 static constexpr std::uint32_t kMinPaymentTotal = 1;
54 static constexpr std::uint32_t kDefaultPaymentTotal = 1;
55 static_assert(kDefaultPaymentTotal >= kMinPaymentTotal);
56
57 static constexpr std::uint32_t kMinPaymentInterval = 60;
60
61 static constexpr std::uint32_t kDefaultGracePeriod = 60;
63};
64
65//------------------------------------------------------------------------------
66
67} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
State information when applying a tx.
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
Definition LoanSet.cpp:47
static TER preclaim(PreclaimContext const &ctx)
Definition LoanSet.cpp:217
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition LoanSet.cpp:169
static constexpr std::uint32_t kDefaultPaymentTotal
static constexpr auto kConsequencesFactory
static constexpr std::uint32_t kMinPaymentTotal
static std::vector< OptionaledField< STNumber > > const & getValueFields()
Definition LoanSet.cpp:196
static NotTEC preflight(PreflightContext const &ctx)
Definition LoanSet.cpp:53
static NotTEC checkSign(PreclaimContext const &ctx)
Definition LoanSet.cpp:141
static constexpr std::uint32_t kDefaultPaymentInterval
static constexpr std::uint32_t kMinPaymentInterval
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 LoanSet.cpp:665
static bool checkExtraFeatures(PreflightContext const &ctx)
Definition LoanSet.cpp:41
TER doApply() override
Definition LoanSet.cpp:369
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
Definition LoanSet.cpp:659
static constexpr std::uint32_t kDefaultGracePeriod
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