mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'ximinez/lending-refactoring-3' into ximinez/lending-refactoring-4
This commit is contained in:
@@ -56,9 +56,12 @@ CreateOffer::checkExtraFeatures(PreflightContext const& ctx)
|
|||||||
std::uint32_t
|
std::uint32_t
|
||||||
CreateOffer::getFlagsMask(PreflightContext const& ctx)
|
CreateOffer::getFlagsMask(PreflightContext const& ctx)
|
||||||
{
|
{
|
||||||
if (ctx.rules.enabled(featurePermissionedDEX) &&
|
// The tfOfferCreateMask is built assuming that PermissionedDEX is
|
||||||
ctx.tx.isFieldPresent(sfDomainID))
|
// enabled
|
||||||
|
if (ctx.rules.enabled(featurePermissionedDEX))
|
||||||
return tfOfferCreateMask;
|
return tfOfferCreateMask;
|
||||||
|
// If PermissionedDEX is not enabled, add tfHybrid to the mask,
|
||||||
|
// indicating it is not allowed.
|
||||||
return tfOfferCreateMask | tfHybrid;
|
return tfOfferCreateMask | tfHybrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,6 +73,9 @@ CreateOffer::preflight(PreflightContext const& ctx)
|
|||||||
|
|
||||||
std::uint32_t const uTxFlags = tx.getFlags();
|
std::uint32_t const uTxFlags = tx.getFlags();
|
||||||
|
|
||||||
|
if (tx.isFlag(tfHybrid) && !tx.isFieldPresent(sfDomainID))
|
||||||
|
return temINVALID_FLAG;
|
||||||
|
|
||||||
bool const bImmediateOrCancel(uTxFlags & tfImmediateOrCancel);
|
bool const bImmediateOrCancel(uTxFlags & tfImmediateOrCancel);
|
||||||
bool const bFillOrKill(uTxFlags & tfFillOrKill);
|
bool const bFillOrKill(uTxFlags & tfFillOrKill);
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ DeleteAccount::checkExtraFeatures(PreflightContext const& ctx)
|
|||||||
if (!ctx.rules.enabled(featureDeletableAccounts))
|
if (!ctx.rules.enabled(featureDeletableAccounts))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return !ctx.tx.isFieldPresent(sfCredentialIDs) ||
|
if (ctx.tx.isFieldPresent(sfCredentialIDs) &&
|
||||||
ctx.rules.enabled(featureCredentials);
|
!ctx.rules.enabled(featureCredentials))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotTEC
|
NotTEC
|
||||||
|
|||||||
@@ -36,10 +36,12 @@ DepositPreauth::checkExtraFeatures(PreflightContext const& ctx)
|
|||||||
bool const authArrPresent = ctx.tx.isFieldPresent(sfAuthorizeCredentials);
|
bool const authArrPresent = ctx.tx.isFieldPresent(sfAuthorizeCredentials);
|
||||||
bool const unauthArrPresent =
|
bool const unauthArrPresent =
|
||||||
ctx.tx.isFieldPresent(sfUnauthorizeCredentials);
|
ctx.tx.isFieldPresent(sfUnauthorizeCredentials);
|
||||||
int const authCredPresent =
|
bool const authCredPresent = authArrPresent || unauthArrPresent;
|
||||||
static_cast<int>(authArrPresent) + static_cast<int>(unauthArrPresent);
|
|
||||||
|
|
||||||
return !authCredPresent || ctx.rules.enabled(featureCredentials);
|
if (authCredPresent && !ctx.rules.enabled(featureCredentials))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotTEC
|
NotTEC
|
||||||
|
|||||||
Reference in New Issue
Block a user