diff --git a/src/test/app/FlowMPT_test.cpp b/src/test/app/FlowMPT_test.cpp index ad3edd49e9..bd47d5b2d7 100644 --- a/src/test/app/FlowMPT_test.cpp +++ b/src/test/app/FlowMPT_test.cpp @@ -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); diff --git a/src/test/app/OfferMPT_test.cpp b/src/test/app/OfferMPT_test.cpp index 0eded72f86..e632e29bdb 100644 --- a/src/test/app/OfferMPT_test.cpp +++ b/src/test/app/OfferMPT_test.cpp @@ -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"); } } }