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

@@ -74,6 +74,7 @@ struct DID_test : public beast::unit_test::suite
// the reserve for creating a DID.
auto const acctReserve = env.current()->fees().accountReserve(0);
auto const incReserve = env.current()->fees().increment;
auto const baseFee = env.current()->fees().base;
env.fund(acctReserve, alice);
env.close();
BEAST_EXPECT(env.balance(alice) == acctReserve);
@@ -85,8 +86,10 @@ struct DID_test : public beast::unit_test::suite
BEAST_EXPECT(ownerCount(env, alice) == 0);
// Pay alice almost enough to make the reserve for a DID.
env(pay(env.master, alice, incReserve + drops(19)));
BEAST_EXPECT(env.balance(alice) == acctReserve + incReserve + drops(9));
env(pay(env.master, alice, drops(incReserve + 2 * baseFee - 1)));
BEAST_EXPECT(
env.balance(alice) ==
acctReserve + incReserve + drops(baseFee - 1));
env.close();
// alice still does not have enough XRP for the reserve of a DID.
@@ -95,7 +98,7 @@ struct DID_test : public beast::unit_test::suite
BEAST_EXPECT(ownerCount(env, alice) == 0);
// Pay alice enough to make the reserve for a DID.
env(pay(env.master, alice, drops(11)));
env(pay(env.master, alice, drops(baseFee + 1)));
env.close();
// Now alice can create a DID.