From 378deaf4ca60d112df5c314788dcea6d9a70aafe Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 7 Jul 2026 17:26:35 -0400 Subject: [PATCH] roll back Batch stuff --- src/libxrpl/tx/transactors/system/Batch.cpp | 10 --------- src/test/app/Sponsor_test.cpp | 23 ++++++--------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/libxrpl/tx/transactors/system/Batch.cpp b/src/libxrpl/tx/transactors/system/Batch.cpp index 926eaad579..d1d1dd806c 100644 --- a/src/libxrpl/tx/transactors/system/Batch.cpp +++ b/src/libxrpl/tx/transactors/system/Batch.cpp @@ -350,16 +350,6 @@ Batch::preflight(PreflightContext const& ctx) return ret; } } - if (stx.isFieldPresent(sfSponsorFlags)) - { - if (isFeeSponsored(stx)) - { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "spfSponsorFee is not allowed on inner Batch. " - << "txID: " << hash; - return temINVALID_FLAG; - } - } // Check that the Fee is native asset (XRP) and zero if (auto const fee = stx.getFieldAmount(sfFee); !fee.native() || fee.xrp() != beast::kZero) diff --git a/src/test/app/Sponsor_test.cpp b/src/test/app/Sponsor_test.cpp index 27d97c0a60..f5297bb19f 100644 --- a/src/test/app/Sponsor_test.cpp +++ b/src/test/app/Sponsor_test.cpp @@ -4608,22 +4608,10 @@ public: env(signers(sponsor, 1, {Signer(signerAccount, 1)})); env.close(); - { - auto jt = env.jtnofill(noop(alice), sponsor::As(sponsor, spfSponsorFee)); - jt.jv.removeMember(sfTxnSignature.jsonName); - - auto const seq = env.seq(alice); - // should fail because Inner transaction cannot include SponsorFlags.SponsorFee - env(batch::outer(alice, seq, XRP(1), tfAllOrNothing), - batch::Inner(jt.jv, seq + 1), - batch::Inner(ticket::create(alice, 1), seq + 2), - Ter(temINVALID_FLAG)); - } - { auto jt = env.jtnofill( noop(alice), - sponsor::As(sponsor, spfSponsorReserve), + sponsor::As(sponsor, spfSponsorReserve | spfSponsorFee), Sig(sfSponsorSignature, sponsor)); jt.jv.removeMember(sfTxnSignature.jsonName); @@ -4640,7 +4628,7 @@ public: { auto jt = env.jtnofill( noop(alice), - sponsor::As(sponsor, spfSponsorReserve), + sponsor::As(sponsor, spfSponsorReserve | spfSponsorFee), Msig(sfSponsorSignature, sponsor, signerAccount)); jt.jv.removeMember(sfTxnSignature.jsonName); @@ -4657,7 +4645,7 @@ public: { auto jt = env.jtnofill( noop(alice), - sponsor::As(sponsor, spfSponsorReserve), + sponsor::As(sponsor, spfSponsorReserve | spfSponsorFee), Sig(sfSponsorSignature, sponsor)); jt.jv.removeMember(sfTxnSignature.jsonName); jt.jv[sfSponsorSignature.jsonName].removeMember(sfTxnSignature.jsonName); @@ -4687,7 +4675,8 @@ public: BEAST_EXPECT(env.balance(sponsor) == XRP(900)); auto jt = env.jtnofill( - check::create(alice, bob, XRP(1)), sponsor::As(sponsor, spfSponsorReserve)); + check::create(alice, bob, XRP(1)), + sponsor::As(sponsor, spfSponsorReserve | spfSponsorFee)); // remove txn signature since it is filled by env.jtnofill() jt.jv.removeMember(jss::TxnSignature); @@ -4722,7 +4711,7 @@ public: auto jt = env.jtnofill( check::create(alice, bob, XRP(1)), - sponsor::As(sponsor, spfSponsorReserve), + sponsor::As(sponsor, spfSponsorReserve | spfSponsorFee), Sig(sfSponsorSignature, sponsor)); // remove txn signature since it is filled by env.jtnofill() jt.jv.removeMember(sfTxnSignature.jsonName);