refactor: Decouple app/tx from Application and Config (#6227)

This change decouples app/tx from `Application` and `Config` to clear the way to moving transactors to `libxrpl`.
This commit is contained in:
Jingchen
2026-02-17 16:29:53 +00:00
committed by GitHub
parent 958d8f3754
commit 36240116a5
46 changed files with 256 additions and 155 deletions

View File

@@ -3,6 +3,7 @@
#include <test/jtx.h>
#include <test/jtx/Env.h>
#include <xrpl/core/NetworkIDService.h>
#include <xrpl/protocol/jss.h>
namespace xrpl {
@@ -58,7 +59,7 @@ public:
// test mainnet
{
test::jtx::Env env{*this, makeNetworkConfig(0)};
BEAST_EXPECT(env.app().config().NETWORK_ID == 0);
BEAST_EXPECT(env.app().getNetworkIDService().getNetworkID() == 0);
// try to submit a txn without network id, this should work
Json::Value jv;
@@ -81,7 +82,7 @@ public:
// NetworkID
{
test::jtx::Env env{*this, makeNetworkConfig(1024)};
BEAST_EXPECT(env.app().config().NETWORK_ID == 1024);
BEAST_EXPECT(env.app().getNetworkIDService().getNetworkID() == 1024);
// try to submit a txn without network id, this should work
Json::Value jv;
@@ -101,7 +102,7 @@ public:
// absent networkid
{
test::jtx::Env env{*this, makeNetworkConfig(1025)};
BEAST_EXPECT(env.app().config().NETWORK_ID == 1025);
BEAST_EXPECT(env.app().getNetworkIDService().getNetworkID() == 1025);
{
env.fund(XRP(200), alice);
// try to submit a txn without network id, this should not work