refactor: Restructure Transactor::preflight to reduce boilerplate (#5592)

* Restructures `Transactor::preflight` to create several functions that will remove the need for error-prone boilerplate code in derived classes' implementations of `preflight`.
This commit is contained in:
Ed Hennis
2025-09-29 17:31:42 -04:00
committed by GitHub
parent 0fd2f715bb
commit d67dcfe3c4
91 changed files with 936 additions and 844 deletions

View File

@@ -26,22 +26,19 @@
namespace ripple {
std::uint32_t
MPTokenAuthorize::getFlagsMask(PreflightContext const& ctx)
{
return tfMPTokenAuthorizeMask;
}
NotTEC
MPTokenAuthorize::preflight(PreflightContext const& ctx)
{
if (!ctx.rules.enabled(featureMPTokensV1))
return temDISABLED;
if (auto const ret = preflight1(ctx); !isTesSuccess(ret))
return ret;
if (ctx.tx.getFlags() & tfMPTokenAuthorizeMask)
return temINVALID_FLAG;
if (ctx.tx[sfAccount] == ctx.tx[~sfHolder])
return temMALFORMED;
return preflight2(ctx);
return tesSUCCESS;
}
TER