xrpld
Loading...
Searching...
No Matches
tx/transactors/sponsor/SponsorshipSet.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/ledger/ReadView.h>
5#include <xrpl/protocol/AccountID.h>
6#include <xrpl/protocol/Keylet.h>
7#include <xrpl/protocol/STLedgerEntry.h>
8#include <xrpl/protocol/STTx.h>
9#include <xrpl/protocol/TER.h>
10#include <xrpl/protocol/XRPAmount.h>
11#include <xrpl/tx/ApplyContext.h>
12#include <xrpl/tx/Transactor.h>
13
14#include <cstdint>
15
16namespace xrpl {
17
19{
20public:
22
24 {
25 }
26
27 static TxConsequences
29
30 static std::uint32_t
32
33 static NotTEC
34 preflight(PreflightContext const& ctx);
35
36 static TER
37 preclaim(PreclaimContext const& ctx);
38
39 TER
40 doApply() override;
41
42 void
43 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
44
45 [[nodiscard]] bool
47 STTx const& tx,
48 TER result,
49 XRPAmount fee,
50 ReadView const& view,
51 beast::Journal const& j) override;
52
53private:
54 TER
56 Keylet const& sponsorshipKeylet,
57 AccountID const& sponsorID,
58 AccountID const& sponseeID,
59 SLE::ref sponsorAccSle,
60 SLE::ref reserveSponsorAccSle);
61};
62
63} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
State information when applying a tx.
A view into a ledger.
Definition ReadView.h:41
std::shared_ptr< STLedgerEntry > const & ref
std::shared_ptr< STLedgerEntry const > const & const_ref
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.
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
TER createSponsorship(Keylet const &sponsorshipKeylet, AccountID const &sponsorID, AccountID const &sponseeID, SLE::ref sponsorAccSle, SLE::ref reserveSponsorAccSle)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
static TxConsequences makeTxConsequences(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
ApplyView & view()
Definition Transactor.h:175
Transactor(Transactor const &)=delete
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition applySteps.h:52
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TERSubset< CanCvtToNotTEC > NotTEC
Definition TER.h:607
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:572
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
TERSubset< CanCvtToTER > TER
Definition TER.h:647
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:20
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:83
State information when preflighting a tx.
Definition Transactor.h:38