feat: XLS-68: Sponsor, #5887 continuation (#7350)

Co-authored-by: tequ <git@tequ.dev>
Co-authored-by: yinyiqian1 <yqian@ripple.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
Co-authored-by: Peter Chen <34582813+PeterChen13579@users.noreply.github.com>
Co-authored-by: Zhiyuan Wang <96991820+Kassaking7@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <asalikhov@ripple.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Zhiyuan Wang <1830604455@qq.com>
This commit is contained in:
Olek
2026-07-10 17:58:19 -04:00
committed by GitHub
parent c7adb215ed
commit fd2cc6dcb3
170 changed files with 13151 additions and 660 deletions

View File

@@ -20,6 +20,8 @@
#include <test/jtx/require.h>
#include <test/jtx/sendmax.h>
#include <test/jtx/seq.h>
#include <test/jtx/sig.h>
#include <test/jtx/sponsor.h>
#include <test/jtx/tags.h>
#include <test/jtx/ter.h>
#include <test/jtx/ticket.h>
@@ -2335,6 +2337,43 @@ public:
BEAST_EXPECT(env.balance(alice) == drops(5));
}
void
testSponsorTxCannotQueue()
{
using namespace jtx;
testcase("disallow sponsored transaction from being queued");
Env env(*this, makeConfig({{Keys::kMinimumTxnInLedgerStandalone, "3"}}));
auto sponsor = Account("sponsor");
auto sponsee = Account("sponsee");
auto filler = Account("filler");
env.fund(XRP(50000), noripple(sponsor, sponsee));
env.close();
env.fund(XRP(50000), noripple(filler));
env.close();
fillQueue(env, filler);
checkMetrics(*this, env, 0, 6, 4, 3);
// Sponsored transactions are not allowed to be queued.
env(noop(sponsee),
sponsor::As(sponsor, spfSponsorFee),
Sig(sfSponsorSignature, sponsor),
Ter(telCAN_NOT_QUEUE));
checkMetrics(*this, env, 0, 6, 4, 3);
// Sponsored transactions may still apply directly if they pay the
// open ledger fee. They just cannot be held in the queue.
env(noop(sponsee),
sponsor::As(sponsor, spfSponsorFee),
Sig(sfSponsorSignature, sponsor),
Fee(openLedgerCost(env)),
Ter(tesSUCCESS));
checkMetrics(*this, env, 0, 6, 5, 3);
}
void
testDelegateTxCannotQueue()
{
@@ -4698,6 +4737,7 @@ public:
testBlockersSeq();
testBlockersTicket();
testInFlightBalance();
testSponsorTxCannotQueue();
testDelegateTxCannotQueue();
testConsequences();
}