remove asfDisallowIncomingSponsor

This commit is contained in:
tequ
2026-03-17 21:13:35 +09:00
parent eb7e01de7e
commit 8d75f3bdc6
6 changed files with 3 additions and 64 deletions

View File

@@ -135,8 +135,7 @@ enum LedgerEntryType : std::uint16_t {
LSF_FLAG(lsfDisallowIncomingPayChan, 0x10000000) /* True, reject new paychans */ \
LSF_FLAG(lsfDisallowIncomingTrustline, 0x20000000) /* True, reject new trustlines (only if no issued assets) */ \
LSF_FLAG(lsfAllowTrustLineLocking, 0x40000000) /* True, enable trustline locking */ \
LSF_FLAG(lsfAllowTrustLineClawback, 0x80000000) /* True, enable clawback */ \
LSF_FLAG(lsfDisallowIncomingSponsor, 0x00004000)) /* True, reject new sponsor */ \
LSF_FLAG(lsfAllowTrustLineClawback, 0x80000000)) /* True, enable clawback */ \
\
LEDGER_OBJECT(Offer, \
LSF_FLAG(lsfPassive, 0x00010000) \

View File

@@ -437,8 +437,7 @@ inline constexpr FlagValue tfDepositSubTx =
ASF_FLAG(asfDisallowIncomingPayChan, 14) \
ASF_FLAG(asfDisallowIncomingTrustline, 15) \
ASF_FLAG(asfAllowTrustLineClawback, 16) \
ASF_FLAG(asfAllowTrustLineLocking, 17) \
ASF_FLAG(asfDisallowIncomingSponsor, 19)
ASF_FLAG(asfAllowTrustLineLocking, 17)
#define ACCOUNTSET_FLAG_TO_VALUE(name, value) inline constexpr FlagValue name = value;
#define ACCOUNTSET_FLAG_TO_MAP(name, value) {#name, value},

View File

@@ -150,10 +150,6 @@ SponsorshipSet::preclaim(PreclaimContext const& ctx)
if (ctx.tx.isFlag(tfDeleteObject) && !sponsorObjSle)
return tecNO_ENTRY;
if (sponseeSle->isFlag(lsfDisallowIncomingSponsor) && !sponsorObjSle)
// new sponsor creation is not allowed by disallowIncomingSponsor flag
return tecNO_PERMISSION;
return tesSUCCESS;
}

View File

@@ -584,14 +584,6 @@ SetAccount::doApply()
else if (uClearFlag == asfDisallowIncomingTrustline)
uFlagsOut &= ~lsfDisallowIncomingTrustline;
if (ctx_.view().rules().enabled(featureSponsor))
{
if (uSetFlag == asfDisallowIncomingSponsor)
uFlagsOut |= lsfDisallowIncomingSponsor;
else if (uClearFlag == asfDisallowIncomingSponsor)
uFlagsOut &= ~lsfDisallowIncomingSponsor;
}
// Set or clear flags for disallowing escrow
if (ctx_.view().rules().enabled(featureTokenEscrow))
{

View File

@@ -64,8 +64,7 @@ public:
}
if (flag == asfDisallowIncomingCheck || flag == asfDisallowIncomingPayChan ||
flag == asfDisallowIncomingNFTokenOffer ||
flag == asfDisallowIncomingTrustline || flag == asfDisallowIncomingSponsor)
flag == asfDisallowIncomingNFTokenOffer || flag == asfDisallowIncomingTrustline)
{
// These flags are part of the DisallowIncoming amendment
// and are tested elsewhere

View File

@@ -186,8 +186,6 @@ public:
env(sponsor::set(sponsor, tfDeleteObject), sponsor::sponseeAcc(alice), ter(tecNO_ENTRY));
env.close();
// DisallowIncomingSponsor: tested in other testcase
// insufficent reserve to create sponsorship
adjustAccountXRPBalance(env, sponsor, reserve(env, 1) - drops(1));
env(sponsor::set(sponsor, 0, 100, XRP(100)), sponsor::sponseeAcc(alice), ter(tecUNFUNDED));
@@ -4832,48 +4830,6 @@ public:
}
}
void
testDisallowIncoming()
{
testcase("DisallowIncoming");
using namespace test::jtx;
Env env{*this, testable_amendments()};
Account const alice("alice");
Account const sponsor("sponsor");
env.fund(XRP(1000000), alice, sponsor);
env.close();
// set DisallowIncomingSponsor
env(fset(alice, asfDisallowIncomingSponsor));
env.close();
// Create sponsor should fail
env(sponsor::set(sponsor, 0, 100, XRP(100)),
sponsor::sponseeAcc(alice),
ter(tecNO_PERMISSION));
env.close();
// clear flag
env(fclear(alice, asfDisallowIncomingSponsor));
env.close();
// Create sponsor
env(sponsor::set(sponsor, 0, 100, XRP(100)), sponsor::sponseeAcc(alice), ter(tesSUCCESS));
env.close();
// set flag
env(fset(alice, asfDisallowIncomingSponsor));
env.close();
// Update sponsor should success
env(sponsor::set(sponsor, 0, 100, XRP(100)), sponsor::sponseeAcc(alice), ter(tesSUCCESS));
env.close();
// Delete sponsor should success
env(sponsor::set(sponsor, tfDeleteObject), sponsor::sponseeAcc(alice), ter(tesSUCCESS));
env.close();
}
void
testAccountDelete()
{
@@ -5309,8 +5265,6 @@ protected:
testSponsorFee();
testSponsorAccount();
testDisallowIncoming();
testAccountDelete();
testDelegatePermission();