mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 10:30:22 +00:00
Move LedgerShortcut to libxrpl.protocol as it's a protocol thing
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
25
include/xrpl/protocol/LedgerShortcut.h
Normal file
25
include/xrpl/protocol/LedgerShortcut.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef XRPL_PROTOCOL_LEDGERSHORTCUT_H_INCLUDED
|
||||
#define XRPL_PROTOCOL_LEDGERSHORTCUT_H_INCLUDED
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
/**
|
||||
* @brief Enumeration of ledger shortcuts for specifying which ledger to use.
|
||||
*
|
||||
* These shortcuts provide a convenient way to reference commonly used ledgers
|
||||
* without needing to specify their exact hash or sequence number.
|
||||
*/
|
||||
enum class LedgerShortcut {
|
||||
/** The current working ledger (open, not yet closed) */
|
||||
Current,
|
||||
|
||||
/** The most recently closed ledger (may not be validated) */
|
||||
Closed,
|
||||
|
||||
/** The most recently validated ledger */
|
||||
Validated
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
#endif
|
||||
@@ -1,13 +1,12 @@
|
||||
#ifndef XRPL_APP_RDB_RELATIONALDATABASE_H_INCLUDED
|
||||
#define XRPL_APP_RDB_RELATIONALDATABASE_H_INCLUDED
|
||||
|
||||
#include <xrpld/app/ledger/Ledger.h>
|
||||
#include <xrpld/app/misc/Transaction.h>
|
||||
#include <xrpld/core/Config.h>
|
||||
#include <xrpld/rpc/detail/RPCLedgerHelpers.h>
|
||||
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/protocol/LedgerShortcut.h>
|
||||
#include <xrpl/rdb/DatabaseCon.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
@@ -71,7 +70,6 @@ public:
|
||||
|
||||
using LedgerSequence = uint32_t;
|
||||
using LedgerHash = uint256;
|
||||
using LedgerShortcut = RPC::LedgerShortcut;
|
||||
using LedgerSpecifier =
|
||||
std::variant<LedgerRange, LedgerShortcut, LedgerSequence, LedgerHash>;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <xrpld/rpc/detail/Tuning.h>
|
||||
|
||||
#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
|
||||
#include <xrpl/protocol/LedgerShortcut.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -20,8 +21,6 @@ namespace RPC {
|
||||
|
||||
struct JsonContext;
|
||||
|
||||
enum class LedgerShortcut { Current, Closed, Validated };
|
||||
|
||||
/**
|
||||
* @brief Retrieves a ledger by its hash.
|
||||
*
|
||||
|
||||
@@ -26,8 +26,6 @@ using TxnsDataBinary = RelationalDatabase::MetaTxsList;
|
||||
using TxnDataBinary = RelationalDatabase::txnMetaLedgerType;
|
||||
using AccountTxArgs = RelationalDatabase::AccountTxArgs;
|
||||
using AccountTxResult = RelationalDatabase::AccountTxResult;
|
||||
|
||||
using LedgerShortcut = RelationalDatabase::LedgerShortcut;
|
||||
using LedgerSpecifier = RelationalDatabase::LedgerSpecifier;
|
||||
|
||||
// parses args into a ledger specifier, or returns a Json object on error
|
||||
|
||||
Reference in New Issue
Block a user