20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/contract.h>
22 #include <ripple/basics/safe_cast.h>
23 #include <ripple/json/to_string.h>
24 #include <ripple/protocol/Indexes.h>
25 #include <ripple/protocol/STLedgerEntry.h>
26 #include <ripple/protocol/jss.h>
27 #include <boost/format.hpp>
38 constexpr
auto const minValidValue =
41 constexpr
auto const maxValidValue =
44 if (type_ < minValidValue || type_ > maxValidValue)
45 Throw<std::runtime_error>(
"invalid ledger entry type: out of range");
49 if (format ==
nullptr)
50 Throw<std::runtime_error>(
"unknown ledger entry type");
52 set(format->getSOTemplate());
76 if (format ==
nullptr)
77 Throw<std::runtime_error>(
"invalid ledger entry type");
79 type_ = format->getType();
88 if (format ==
nullptr)
89 Throw<std::runtime_error>(
"invalid ledger entry type");
94 ret += format->getName();
133 JLOG(
debugLog().info()) <<
"Thread Tx:" << txID <<
" prev:" << oldPrevTxID;
135 if (oldPrevTxID == txID)
142 prevTxID = oldPrevTxID;
const SF_UINT32 sfPreviousTxnLgrSeq
const SF_HASH256 sfPreviousTxnID
A pair of SHAMap key and LedgerEntryType.
Json::Value getJson(JsonOptions options) const override
void setFieldU16(SField const &field, std::uint16_t)
std::string getFullText() const override
beast::Journal debugLog()
Returns a debug journal.
const SField sfLedgerEntry
virtual std::string getFullText() const override
void applyTemplate(const SOTemplate &type) noexcept(false)
void setFieldH256(SField const &field, uint256 const &)
std::string getText() const override
STLedgerEntry(Keylet const &k)
Create an empty object with the given key and type.
std::uint16_t getFieldU16(SField const &field) const
int getFieldIndex(SField const &field) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const SF_UINT16 sfLedgerEntryType
bool thread(uint256 const &txID, std::uint32_t ledgerSeq, uint256 &prevTxID, std::uint32_t &prevLedgerID)
LedgerEntryType
Ledger entry types.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
std::uint32_t getFieldU32(SField const &field) const
bool isThreadedType() const
virtual Json::Value getJson(JsonOptions options) const override
void set(const SOTemplate &)
void setFieldU32(SField const &field, std::uint32_t)
virtual std::string getText() const override
uint256 getFieldH256(SField const &field) const