Decouple app/tx from Application

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2026-01-09 12:13:21 +00:00
parent d5fc0cdc5b
commit 2c1eebbd2c
58 changed files with 398 additions and 257 deletions

View File

@@ -0,0 +1,36 @@
#ifndef XRPL_CORE_NETWORKIDSERVICE_H_INCLUDED
#define XRPL_CORE_NETWORKIDSERVICE_H_INCLUDED
#include <cstdint>
namespace xrpl {
/** Service that provides access to the network ID.
This service provides read-only access to the network ID configured
for this server. The network ID identifies which network (mainnet,
testnet, devnet, or custom network) this server is configured to
connect to.
Well-known network IDs:
- 0: Mainnet
- 1: Testnet
- 2: Devnet
- 1025+: Custom networks (require NetworkID field in transactions)
*/
class NetworkIDService
{
public:
virtual ~NetworkIDService() = default;
/** Get the configured network ID
*
* @return The network ID this server is configured for
*/
virtual std::uint32_t
getNetworkID() const = 0;
};
} // namespace xrpl
#endif

View File

@@ -47,6 +47,7 @@ class LoadFeeTrack;
class LoadManager;
class ManifestCache;
class NetworkOPs;
class NetworkIDService;
class OpenLedger;
class OrderBookDB;
class Overlay;
@@ -112,6 +113,9 @@ public:
virtual LedgerConfigService&
getLedgerConfigService() = 0;
virtual NetworkIDService&
getNetworkIDService() = 0;
// Protocol and validation services
virtual AmendmentTable&
getAmendmentTable() = 0;
@@ -227,6 +231,9 @@ public:
virtual Logs&
logs() = 0;
virtual std::optional<uint256> const&
trapTxID() const = 0;
// Temporary: Get the underlying Application for functions that haven't
// been migrated yet. This should be removed once all code is migrated.
virtual Application&