xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
tx
transactors
system
Change.h
1
#pragma once
2
3
#include <xrpl/beast/utility/Journal.h>
4
#include <xrpl/core/ServiceRegistry.h>
5
#include <xrpl/ledger/ReadView.h>
6
#include <xrpl/protocol/STTx.h>
7
#include <xrpl/protocol/TER.h>
8
#include <xrpl/protocol/XRPAmount.h>
9
#include <xrpl/tx/ApplyContext.h>
10
#include <xrpl/tx/Transactor.h>
11
12
namespace
xrpl
{
13
14
class
Change
:
public
Transactor
15
{
16
public
:
17
static
constexpr
auto
kConsequencesFactory
=
ConsequencesFactoryType::Normal
;
18
19
explicit
Change
(
ApplyContext
& ctx) :
Transactor
(ctx)
20
{
21
}
22
23
TER
24
doApply
()
override
;
25
void
26
preCompute
()
override
;
27
28
void
29
visitInvariantEntry
(
bool
isDelete,
SLE::ConstRef
before,
SLE::ConstRef
after
)
override
;
30
31
[[nodiscard]]
bool
32
finalizeInvariants
(
33
STTx
const
& tx,
34
TER
result,
35
XRPAmount
fee,
36
ReadView
const
&
view
,
37
beast::Journal
const
& j)
override
;
38
39
static
XRPAmount
40
calculateBaseFee
(
ReadView
const
&
view
,
STTx
const
& tx)
41
{
42
return
XRPAmount
{0};
43
}
44
45
static
TER
46
preclaim
(
PreclaimContext
const
& ctx);
47
48
private
:
49
TER
50
applyAmendment
();
51
52
TER
53
applyFee
();
54
55
TER
56
applyUNLModify
();
57
};
58
59
using
EnableAmendment
=
Change
;
60
using
SetFee
=
Change
;
61
using
UNLModify
=
Change
;
62
63
}
// namespace xrpl
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::ApplyContext
State information when applying a tx.
Definition
ApplyContext.h:28
xrpl::Change
Definition
Change.h:15
xrpl::Change::Change
Change(ApplyContext &ctx)
Definition
Change.h:19
xrpl::Change::finalizeInvariants
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
Change.cpp:420
xrpl::Change::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition
Change.h:40
xrpl::Change::preclaim
static TER preclaim(PreclaimContext const &ctx)
Definition
Change.cpp:77
xrpl::Change::applyUNLModify
TER applyUNLModify()
Definition
Change.cpp:298
xrpl::Change::doApply
TER doApply() override
Definition
Change.cpp:143
xrpl::Change::visitInvariantEntry
void visitInvariantEntry(bool isDelete, SLE::ConstRef before, SLE::ConstRef after) override
Inspect a single ledger entry modified by this transaction.
Definition
Change.cpp:414
xrpl::Change::applyAmendment
TER applyAmendment()
Definition
Change.cpp:168
xrpl::Change::preCompute
void preCompute() override
Definition
Change.cpp:162
xrpl::Change::applyFee
TER applyFee()
Definition
Change.cpp:260
xrpl::Change::kConsequencesFactory
static constexpr auto kConsequencesFactory
Definition
Change.h:17
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:41
xrpl::STLedgerEntry::ConstRef
std::shared_ptr< STLedgerEntry const > const & ConstRef
Definition
STLedgerEntry.h:37
xrpl::STTx
Definition
STTx.h:43
xrpl::Transactor::ConsequencesFactoryType::Normal
@ Normal
Definition
Transactor.h:175
xrpl::Transactor::view
ApplyView & view()
Definition
Transactor.h:184
xrpl::Transactor::Transactor
Transactor(Transactor const &)=delete
xrpl::XRPAmount
Definition
XRPAmount.h:28
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition
View.cpp:644
xrpl::SetFee
Change SetFee
Definition
Change.h:60
xrpl::TER
TERSubset< CanCvtToTER > TER
Definition
TER.h:654
xrpl::EnableAmendment
Change EnableAmendment
Definition
Change.h:59
xrpl::UNLModify
Change UNLModify
Definition
Change.h:61
xrpl::PreclaimContext
State information when determining if a tx is likely to claim a fee.
Definition
Transactor.h:92
Generated by
1.17.0