Add test for no SponsorFlag with valid sponsor

This commit is contained in:
tequ
2026-04-10 13:45:14 +09:00
parent 831f99862d
commit 71003699dc
2 changed files with 11 additions and 8 deletions

View File

@@ -185,6 +185,11 @@ Transactor::preflight1(PreflightContext const& ctx, std::uint32_t flagMask)
return temINVALID_FLAG;
}
}
else
{
JLOG(ctx.j.debug()) << "preflight1: no sponsor flags";
return temINVALID_FLAG;
}
if (auto const ret = preflight0(ctx, flagMask))
return ret;
@@ -232,13 +237,6 @@ Transactor::preflight1(PreflightContext const& ctx, std::uint32_t flagMask)
return temMALFORMED;
}
// if (hasSponsor && hasSponsorFlags &&
// ctx.tx.getFieldU32(sfSponsorFlags) == 0)
// {
// JLOG(ctx.j.debug()) << "preflight1: sponsor with no sponsorship flags";
// return temINVALID_FLAG;
// }
return tesSUCCESS;
}

View File

@@ -422,8 +422,13 @@ public:
// SponsorFlags=0 with valid sponsor (no sponsorship purpose)
env(noop(alice), sponsor::as(sponsor, 0), ter(temINVALID_FLAG));
// Invalid Flags without sponsor
// no SponsorFlag with valid sponsor
auto tx = noop(alice);
tx[sfSponsor.jsonName] = sponsor.human();
env(tx, ter(temINVALID_FLAG));
// Invalid Flags without sponsor
tx = noop(alice);
tx[sfSponsorFlags.jsonName] = spfSponsorFee | spfSponsorReserve;
env(tx, ter(temINVALID_FLAG));
}