test: enable unit tests to work with variable reference fee (#5145)

Fix remaining unit tests to be able to process reference fee values other than 10.
This commit is contained in:
Vlad
2025-03-25 14:31:25 +00:00
committed by GitHub
parent 67028d6ea6
commit 2bc5cb240f
37 changed files with 801 additions and 384 deletions

View File

@@ -172,6 +172,7 @@ public:
using namespace std::chrono_literals;
using namespace jtx;
Env env(*this);
auto baseFee = env.current()->fees().base.drops();
auto wsc = makeWSClient(env.app().config());
Json::Value stream;
@@ -203,9 +204,9 @@ public:
jv[jss::transaction][jss::TransactionType] //
== jss::Payment &&
jv[jss::transaction][jss::DeliverMax] //
== "10000000010" &&
== std::to_string(10000000000 + baseFee) &&
jv[jss::transaction][jss::Fee] //
== "10" &&
== std::to_string(baseFee) &&
jv[jss::transaction][jss::Sequence] //
== 1;
}));
@@ -228,9 +229,9 @@ public:
jv[jss::transaction][jss::TransactionType] //
== jss::Payment &&
jv[jss::transaction][jss::DeliverMax] //
== "10000000010" &&
== std::to_string(10000000000 + baseFee) &&
jv[jss::transaction][jss::Fee] //
== "10" &&
== std::to_string(baseFee) &&
jv[jss::transaction][jss::Sequence] //
== 2;
}));
@@ -318,7 +319,10 @@ public:
using namespace std::chrono_literals;
using namespace jtx;
Env env(*this);
Env env(*this, envconfig([](std::unique_ptr<Config> cfg) {
cfg->FEES.reference_fee = 10;
return cfg;
}));
auto wsc = makeWSClient(env.app().config());
Json::Value stream{Json::objectValue};