3#include <xrpl/basics/CountedObject.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/CachedView.h>
6#include <xrpl/ledger/View.h>
7#include <xrpl/protocol/Fees.h>
8#include <xrpl/protocol/Indexes.h>
9#include <xrpl/protocol/Rules.h>
10#include <xrpl/protocol/STLedgerEntry.h>
11#include <xrpl/protocol/Serializer.h>
12#include <xrpl/protocol/TxMeta.h>
13#include <xrpl/shamap/SHAMap.h>
19class TransactionMaster;
257 bool correctCloseTime);
381 class sles_iter_impl;
A generic endpoint for log messages.
Wraps a DigestAwareReadView to provide caching.
Tracks the number of instances of an object.
ReadView that associates keys with digests.
bool txExists(uint256 const &key) const override
std::unique_ptr< txs_type::iter_base > txsEnd() const override
bool isFlagLedger() const
Returns true if the ledger is a flag ledger.
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
void rawTxInsert(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
std::optional< PublicKey > validatorToDisable() const
get the to be disabled validator's master public key if any
void setLedgerInfo(LedgerHeader const &info)
uint256 rawTxInsertWithHash(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
void setValidated() const
void updateNegativeUNL()
update the Negative UNL ledger component.
bool isVotingLedger() const
Returns true if the ledger directly precedes a flag ledger.
std::unique_ptr< sles_type::iter_base > slesBegin() const override
hash_set< PublicKey > negativeUNL() const
get Negative UNL validators' master public keys
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
void setImmutable(bool rehash=true)
SHAMap const & stateMap() const
SHAMap const & txMap() const
bool open() const override
Returns true if this reflects an open ledger.
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
static std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > deserializeTxPlusMeta(SHAMapItem const &item)
Deserialize a SHAMapItem containing STTx + STObject metadata.
LedgerHeader const & header() const override
Returns information about the ledger.
void setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
Ledger(Ledger const &)=delete
static std::shared_ptr< STTx const > deserializeTx(SHAMapItem const &item)
Deserialize a SHAMapItem containing a single STTx.
Ledger & operator=(Ledger const &)=delete
std::shared_ptr< SLE > peek(Keylet const &k) const
void setTotalDrops(std::uint64_t totDrops)
bool addSLE(SLE const &sle)
void rawDestroyXRP(XRPAmount const &fee) override
Destroy XRP.
std::unique_ptr< txs_type::iter_base > txsBegin() const override
std::unique_ptr< sles_type::iter_base > slesEnd() const override
std::optional< uint256 > succ(uint256 const &key, std::optional< uint256 > const &last=std::nullopt) const override
Ledger & operator=(Ledger &&)=delete
Rules const & rules() const override
Returns the tx processing rules.
Fees const & fees() const override
Returns the fees for the base ledger.
bool walkLedger(beast::Journal j, bool parallel=false) const
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
std::optional< PublicKey > validatorToReEnable() const
get the to be re-enabled validator's master public key if any
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
bool exists(Keylet const &k) const override
Determine if a state item exists.
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > tx_type
Rules controlling protocol behavior.
A SHAMap is both a radix tree with a fan-out of 16 and a Merkle tree.
void setLedgerSeq(std::uint32_t lseq)
Interface for changing ledger entries with transactions.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
create_genesis_t const create_genesis
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
create_genesis_t()=default