mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user