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>
35 type_ <= std::min<unsigned>(
39 Throw<std::runtime_error>(
"invalid ledger entry type: out of range");
42 if (format ==
nullptr)
43 Throw<std::runtime_error>(
"invalid ledger entry type");
45 set(format->getSOTemplate());
69 if (format ==
nullptr)
70 Throw<std::runtime_error>(
"invalid ledger entry type");
72 type_ = format->getType();
81 if (format ==
nullptr)
82 Throw<std::runtime_error>(
"invalid ledger entry type");
87 ret += format->getName();
126 JLOG(
debugLog().info()) <<
"Thread Tx:" << txID <<
" prev:" << oldPrevTxID;
128 if (oldPrevTxID == txID)
135 prevTxID = oldPrevTxID;
A pair of SHAMap key and LedgerEntryType.
Json::Value getJson(JsonOptions options) const override
void setFieldU16(SField const &field, std::uint16_t)
const SF_U32 sfPreviousTxnLgrSeq(access, STI_UINT32, 5, "PreviousTxnLgrSeq", SField::sMD_DeleteFinal)
const SF_U16 sfLedgerEntryType(access, STI_UINT16, 1, "LedgerEntryType", SField::sMD_Never)
std::string getFullText() const override
std::string to_string(ListDisposition disposition)
beast::Journal debugLog()
Returns a debug journal.
const SField sfLedgerEntry(access, STI_LEDGERENTRY, 257, "LedgerEntry")
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.
bool thread(uint256 const &txID, std::uint32_t ledgerSeq, uint256 &prevTxID, std::uint32_t &prevLedgerID)
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)
const SF_U256 sfPreviousTxnID(access, STI_HASH256, 5, "PreviousTxnID", SField::sMD_DeleteFinal)
virtual std::string getText() const override
uint256 getFieldH256(SField const &field) const