3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/STTx.h>
7#include <xrpl/protocol/TER.h>
8#include <xrpl/tx/invariants/AMMInvariant.h>
9#include <xrpl/tx/invariants/FreezeInvariant.h>
10#include <xrpl/tx/invariants/LoanBrokerInvariant.h>
11#include <xrpl/tx/invariants/LoanInvariant.h>
12#include <xrpl/tx/invariants/MPTInvariant.h>
13#include <xrpl/tx/invariants/NFTInvariant.h>
14#include <xrpl/tx/invariants/PermissionedDEXInvariant.h>
15#include <xrpl/tx/invariants/PermissionedDomainInvariant.h>
16#include <xrpl/tx/invariants/VaultInvariant.h>
A generic endpoint for log messages.
Invariant: a deleted account must not have any objects left.
std::vector< std::pair< std::shared_ptr< SLE const >, std::shared_ptr< SLE const > > > accountsDeleted_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Invariant: we cannot remove an account ledger entry.
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
std::uint32_t accountsDeleted_
Prototype for invariant check implementations.
bool finalize(STTx const &tx, TER const tec, XRPAmount const fee, ReadView const &view, beast::Journal const &j)
called after all ledger entries have been visited to determine the final status of the check.
void visitEntry(bool isDelete, std::shared_ptr< SLE const > const &before, std::shared_ptr< SLE const > const &after)
called for each ledger entry in the current transaction.
InvariantChecker_PROTOTYPE()=default
Invariant: corresponding modified ledger entries should match in type and added entries should be a v...
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
Invariant: Validates counts of NFTokens after all transaction types.
Invariant: offers should be for non-negative amounts and must not be XRP to XRP.
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Invariant: Trust lines with deep freeze flag are not allowed if normal freeze flag is not set.
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
bool deepFreezeWithoutFreeze_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
Invariants: Some fields are unmodifiable.
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
std::set< std::pair< SLE::const_pointer, SLE::const_pointer > > changedEntries_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Invariant: Trust lines using XRP are not allowed.
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
Invariant: an escrow entry must take a value between 0 and INITIAL_XRP drops exclusive.
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Invariant: We should never charge a transaction a negative fee or a fee that is larger than what the ...
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
static bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Invariant: frozen trust line balance change is not allowed.
Invariant: Token holder's trustline balance cannot be negative after Clawback.
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
std::uint32_t trustlinesChanged
std::uint32_t mptokensChanged
Invariants: Loan brokers are internally consistent.
Invariants: Loans are internally consistent.
Invariant: Validates several invariants for NFToken pages.
Invariant: a new account root must be the consequence of a payment, must have the right starting sequ...
std::uint32_t accountsCreated_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
std::uint32_t accountSeq_
Invariants: Permissioned Domains must have some rules and AcceptedCredentials must have length betwee...
Invariants: Pseudo-accounts have valid and consistent properties.
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
std::vector< std::string > errors_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Invariant: An account XRP balance must be in XRP and take a value between 0 and INITIAL_XRP drops,...
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
Invariant: A transaction must not create XRP and should only destroy the XRP fee.
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
InvariantChecks getInvariantChecks()
get a tuple of all invariant checks
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?