1#include <xrpld/app/misc/Transaction.h>
3#include <xrpld/app/ledger/LedgerMaster.h>
4#include <xrpld/app/main/Application.h>
5#include <xrpld/rpc/CTID.h>
7#include <xrpl/basics/Blob.h>
8#include <xrpl/basics/RangeSet.h>
9#include <xrpl/basics/Slice.h>
10#include <xrpl/basics/safe_cast.h>
11#include <xrpl/beast/utility/instrumentation.h>
12#include <xrpl/json/json_value.h>
13#include <xrpl/protocol/ErrorCodes.h>
14#include <xrpl/protocol/SField.h>
15#include <xrpl/protocol/STBase.h>
16#include <xrpl/protocol/STTx.h>
17#include <xrpl/protocol/Serializer.h>
18#include <xrpl/protocol/TxMeta.h>
19#include <xrpl/protocol/TxSearched.h>
20#include <xrpl/protocol/jss.h>
21#include <xrpl/rdb/RelationalDatabase.h>
23#include <boost/optional/optional.hpp>
78 switch (
static_cast<TxnSql>(c))
93 "xrpl::Transaction::sqlTransactionStatus : unknown transaction status");
101 boost::optional<std::uint64_t>
const& ledgerSeq,
102 boost::optional<std::string>
const& status,
114 tr->setLedger(inLedger);
121 return load(
id, app, std::nullopt, ec);
174 ret[jss::date] = ct->time_since_epoch().count();
187 ret[jss::ctid] = *ctid;
virtual std::variant< AccountTx, TxSearched > getTransaction(uint256 const &id, std::optional< ClosedInterval< uint32_t > > const &range, ErrorCodeI &ec)=0
getTransaction Returns the transaction with the given hash.
virtual RelationalDatabase & getRelationalDatabase()=0
json::Value getJson(JsonOptions options, bool binary=false) const
static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > load(uint256 const &id, Application &app, ErrorCodeI &ec)
void setStatus(TransStatus status, std::uint32_t ledgerSeq, std::optional< uint32_t > transactionSeq=std::nullopt, std::optional< uint32_t > networkID=std::nullopt)
std::shared_ptr< STTx const > transaction_
std::optional< uint32_t > txnSeq_
static Transaction::pointer transactionFromSQL(boost::optional< std::uint64_t > const &ledgerSeq, boost::optional< std::string > const &status, Blob const &rawTxn, Application &app)
std::optional< uint32_t > networkID_
Transaction(std::shared_ptr< STTx const > const &, std::string &, Application &) noexcept
std::shared_ptr< Transaction > pointer
static TransStatus sqlTransactionStatus(boost::optional< std::string > const &status)
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > safeCast(Src s) noexcept
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
std::vector< unsigned char > Blob
Storage for linear binary data.
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, Slice > makeSlice(std::array< T, N > const &a)
Note, should be treated as flags that can be | and &.
unsigned int underlying_t