mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 01:06:48 +00:00
Add test for no SponsorFlag with valid sponsor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user