xrpld
Loading...
Searching...
No Matches
tx/transactors/lending/LoanManage.h
1#pragma once
2
3#include <xrpl/tx/Transactor.h>
4
5namespace xrpl {
6
7class LoanManage : public Transactor
8{
9public:
11
12 explicit LoanManage(ApplyContext& ctx) : Transactor(ctx)
13 {
14 }
15
16 static bool
18
19 static std::uint32_t
21
22 static NotTEC
23 preflight(PreflightContext const& ctx);
24
25 static TER
26 preclaim(PreclaimContext const& ctx);
27
30 static TER
33 SLE::ref loanSle,
34 SLE::ref brokerSle,
35 SLE::ref vaultSle,
36 Asset const& vaultAsset,
38
41 static TER
44 SLE::ref loanSle,
45 SLE::ref vaultSle,
46 Asset const& vaultAsset,
48
51 [[nodiscard]] static TER
54 SLE::ref loanSle,
55 SLE::ref vaultSle,
56 Asset const& vaultAsset,
58
59 TER
60 doApply() override;
61
62 void
63 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
64
65 [[nodiscard]] bool
67 STTx const& tx,
68 TER result,
69 XRPAmount fee,
70 ReadView const& view,
71 beast::Journal const& j) override;
72};
73
74//------------------------------------------------------------------------------
75
76} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
State information when applying a tx.
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:118
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
static TER defaultLoan(ApplyView &view, SLE::ref loanSle, SLE::ref brokerSle, SLE::ref vaultSle, Asset const &vaultAsset, beast::Journal j)
Helper function that might be needed by other transactors.
static TER preclaim(PreclaimContext const &ctx)
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.
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static TER unimpairLoan(ApplyView &view, SLE::ref loanSle, SLE::ref vaultSle, Asset const &vaultAsset, beast::Journal j)
Helper function that might be needed by other transactors.
static TER impairLoan(ApplyView &view, SLE::ref loanSle, SLE::ref vaultSle, Asset const &vaultAsset, beast::Journal j)
Helper function that might be needed by other transactors.
TER doApply() override
static NotTEC preflight(PreflightContext const &ctx)
static bool checkExtraFeatures(PreflightContext const &ctx)
static constexpr auto kConsequencesFactory
A view into a ledger.
Definition ReadView.h:31
std::shared_ptr< STLedgerEntry > const & ref
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