xrpld
Loading...
Searching...
No Matches
tx/transactors/account/SignerListSet.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/core/ServiceRegistry.h>
5#include <xrpl/ledger/ApplyView.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/Rules.h>
9#include <xrpl/protocol/STTx.h>
10#include <xrpl/protocol/TER.h>
11#include <xrpl/protocol/XRPAmount.h>
12#include <xrpl/tx/ApplyContext.h>
13#include <xrpl/tx/SignerEntries.h>
14#include <xrpl/tx/Transactor.h>
15
16#include <cstdint>
17#include <tuple>
18#include <vector>
19
20namespace xrpl {
21
27{
28private:
29 // Values determined during preCompute for use later.
30 enum class Operation { Unknown, Set, Destroy };
34
35public:
37
39 {
40 }
41
42 static std::uint32_t
44
45 static NotTEC
46 preflight(PreflightContext const& ctx);
47
48 TER
49 doApply() override;
50 void
51 preCompute() override;
52
53 void
54 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
55
56 [[nodiscard]] bool
58 STTx const& tx,
59 TER result,
60 XRPAmount fee,
61 ReadView const& view,
62 beast::Journal const& j) override;
63
64 // Interface used by AccountDelete
65 static TER
67 ServiceRegistry& registry,
69 AccountID const& account,
71
72private:
75
76 static NotTEC
78 std::uint32_t quorum,
80 AccountID const& account,
82 Rules const&);
83
84 TER
86 TER
88
89 void
90 writeSignersToSLE(SLE::pointer const& ledgerEntry, std::uint32_t flags) const;
91};
92
93} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
State information when applying a tx.
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:134
A view into a ledger.
Definition ReadView.h:41
Rules controlling protocol behavior.
Definition Rules.h:40
std::shared_ptr< STLedgerEntry > pointer
std::shared_ptr< STLedgerEntry const > const & const_ref
Service registry for dependency injection.
static NotTEC preflight(PreflightContext const &ctx)
void preCompute() override
static std::tuple< NotTEC, std::uint32_t, std::vector< SignerEntries::SignerEntry >, Operation > determineOperation(STTx const &tx, ApplyFlags flags, beast::Journal j)
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 NotTEC validateQuorumAndSignerEntries(std::uint32_t quorum, std::vector< SignerEntries::SignerEntry > const &signers, AccountID const &account, beast::Journal j, Rules const &)
TER doApply() override
std::vector< SignerEntries::SignerEntry > signers_
static TER removeFromLedger(ServiceRegistry &registry, ApplyView &view, AccountID const &account, beast::Journal j)
void writeSignersToSLE(SLE::pointer const &ledgerEntry, std::uint32_t flags) const
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
ApplyView & view()
Definition Transactor.h:175
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:607
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:572
ApplyFlags
Definition ApplyView.h:27
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
State information when preflighting a tx.
Definition Transactor.h:38