Fix non-default unit test reference fee

This commit is contained in:
Gregory Tsipenyuk
2026-07-14 18:08:40 -04:00
parent f84416edf6
commit b8dca62cb2
2 changed files with 18 additions and 6 deletions

View File

@@ -658,6 +658,7 @@ struct FlowMPT_test : public beast::unit_test::Suite
std::int64_t constexpr offerAmount = deliverAmount + (deliverAmount / 2);
env.fund(XRP(10'000), iouGW, mptGW, alice, bob);
env.close();
auto const usd = iouGW["USD"];
env.trust(usd(offerAmount), alice);
@@ -686,6 +687,7 @@ struct FlowMPT_test : public beast::unit_test::Suite
std::int64_t constexpr overflowAmount = 7'000'000'000'000'000'000LL;
env.fund(XRP(10'000), iouGW, mptGW, alice, bob);
env.close();
auto const usd = iouGW["USD"];
env.trust(usd(overflowAmount), alice);

View File

@@ -5203,8 +5203,8 @@ public:
BEAST_EXPECT(secondOffer[jss::taker_pays_funded] == "500000000");
});
// An MPT global lock removes the locked MPT book liquidity from the
// public snapshot instead of reporting it as funded.
// An MPT global lock makes book_offers report the locked MPT book
// liquidity as zero-funded instead of funded.
{
Env env{*this, features};
@@ -5221,6 +5221,7 @@ public:
auto const offerSeq = env.seq(maker);
env(offer(maker, XRP(100), usd(100)));
env.close();
{
json::Value const jrr = getBookOffers(env, XRP, usd);
@@ -5240,10 +5241,19 @@ public:
musd.set({.flags = tfMPTLock});
{
json::Value const jrr = getBookOffers(env, XRP, usd);
json::Value const& bookOffers = jrr[jss::offers];
BEAST_EXPECT(bookOffers.isArray());
BEAST_EXPECT(bookOffers.size() == 0);
// The lock does not remove the offer from the ledger;
// book_offers must report it as zero-funded liquidity.
auto const bookOffers = getBookOffers(env, XRP, usd)[jss::offers];
BEAST_EXPECT(bookOffers.isArray() && bookOffers.size() == 1);
json::Value const& offer = bookOffers[0u];
BEAST_EXPECT(offer[sfAccount] == maker.human());
BEAST_EXPECT(offer[sfSequence] == offerSeq);
BEAST_EXPECT(offer[jss::owner_funds] == "0");
BEAST_EXPECT(offer.isMember(jss::taker_gets_funded));
BEAST_EXPECT(offer[jss::taker_gets_funded][jss::value] == "0");
BEAST_EXPECT(offer.isMember(jss::taker_pays_funded));
BEAST_EXPECT(offer[jss::taker_pays_funded] == "0");
}
}
}