From 4d2945323d8d8638b295a3415dce4b33d18bc7cc Mon Sep 17 00:00:00 2001 From: tequ Date: Fri, 10 Apr 2026 04:21:11 +0900 Subject: [PATCH] fix AccountObjects_test.cpp error --- src/test/rpc/AccountObjects_test.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index 4a4e067305..ed261bca84 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -1396,14 +1396,11 @@ public: env(trust(bob, USD(1000))); env.close(); - // sponsored=true should find the sponsorship object for bob + // sponsored=true should not find any objects for bob (doesn't have any sponsored objects) { auto const resp = acctObjsSponsored(bob.id(), true); auto const& objs = resp[jss::result][jss::account_objects]; - // bob has sponsorship object (which has sfSponsor? no - it's in owner dir) - // Actually the Sponsorship SLE itself doesn't have sfSponsor on it - // Let's just check the count - BEAST_EXPECT(objs.size() >= 0); + BEAST_EXPECT(objs.size() == 0); } // Now sponsor bob's trust line @@ -1426,10 +1423,16 @@ public: auto const resp = acctObjsSponsored(bob.id(), true); auto const& objs = resp[jss::result][jss::account_objects]; bool foundTrustLine = false; + BEAST_EXPECT(objs.size() == 1); for (auto const& obj : objs) { if (obj[sfLedgerEntryType.jsonName] == jss::RippleState) + { + BEAST_EXPECT( + obj.isMember(sfHighSponsor.jsonName) || + obj.isMember(sfLowSponsor.jsonName)); foundTrustLine = true; + } } BEAST_EXPECT(foundTrustLine); }