mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 16:35:53 +00:00
Merge branch 'ximinez/lending-refactoring-3' into ximinez/lending-refactoring-4
This commit is contained in:
@@ -33,12 +33,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
AMMClawback::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureAMMClawback);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
AMMClawback::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -164,12 +164,6 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx)
|
||||
return signerFees + txnFees + batchBase;
|
||||
}
|
||||
|
||||
bool
|
||||
Batch::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureBatch);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
Batch::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -40,9 +40,6 @@ public:
|
||||
static XRPAmount
|
||||
calculateBaseFee(ReadView const& view, STTx const& tx);
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -29,12 +29,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
CancelCheck::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureChecks);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
CancelCheck::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
CashCheck::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureChecks);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
CashCheck::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -75,12 +75,6 @@ preflightHelper<MPTIssue>(PreflightContext const& ctx)
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
bool
|
||||
Clawback::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureClawback);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
Clawback::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
CreateCheck::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureChecks);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
CreateCheck::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -33,12 +33,6 @@ CreateTicket::makeTxConsequences(PreflightContext const& ctx)
|
||||
return TxConsequences{ctx.tx, ctx.tx[sfTicketCount]};
|
||||
}
|
||||
|
||||
bool
|
||||
CreateTicket::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureTicketBatch);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
CreateTicket::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -69,9 +69,6 @@ public:
|
||||
static TxConsequences
|
||||
makeTxConsequences(PreflightContext const& ctx);
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
/** Enforce constraints beyond those of the Transactor base class. */
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
@@ -48,12 +48,6 @@ using namespace credentials;
|
||||
|
||||
// ------- CREATE --------------------------
|
||||
|
||||
bool
|
||||
CredentialCreate::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureCredentials);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
CredentialCreate::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
@@ -199,11 +193,6 @@ CredentialCreate::doApply()
|
||||
}
|
||||
|
||||
// ------- DELETE --------------------------
|
||||
bool
|
||||
CredentialDelete::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureCredentials);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
CredentialDelete::getFlagsMask(PreflightContext const& ctx)
|
||||
@@ -283,12 +272,6 @@ CredentialDelete::doApply()
|
||||
|
||||
// ------- APPLY --------------------------
|
||||
|
||||
bool
|
||||
CredentialAccept::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureCredentials);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
CredentialAccept::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
@@ -60,9 +57,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
@@ -87,9 +81,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -42,12 +42,6 @@ namespace ripple {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool
|
||||
DIDSet::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureDID);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
DIDSet::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
@@ -168,12 +162,6 @@ DIDSet::doApply()
|
||||
return addSLE(ctx_, sleDID, account_);
|
||||
}
|
||||
|
||||
bool
|
||||
DIDDelete::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureDID);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
DIDDelete::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
@@ -54,9 +51,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
DelegateSet::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featurePermissionDelegation);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
DelegateSet::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
DeleteOracle::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featurePriceOracle);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
DeleteOracle::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -42,9 +42,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -33,9 +33,6 @@ namespace ripple {
|
||||
bool
|
||||
DepositPreauth::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
if (!ctx.rules.enabled(featureDepositPreauth))
|
||||
return false;
|
||||
|
||||
bool const authArrPresent = ctx.tx.isFieldPresent(sfAuthorizeCredentials);
|
||||
bool const unauthArrPresent =
|
||||
ctx.tx.isFieldPresent(sfUnauthorizeCredentials);
|
||||
|
||||
@@ -27,12 +27,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
LedgerStateFix::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(fixNFTokenPageLinks);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
LedgerStateFix::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -37,9 +37,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
MPTokenAuthorize::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureMPTokensV1);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
MPTokenAuthorize::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -42,9 +42,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -28,9 +28,6 @@ namespace ripple {
|
||||
bool
|
||||
MPTokenIssuanceCreate::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
if (!ctx.rules.enabled(featureMPTokensV1))
|
||||
return false;
|
||||
|
||||
if (ctx.tx.isFieldPresent(sfDomainID) &&
|
||||
!(ctx.rules.enabled(featurePermissionedDomains) &&
|
||||
ctx.rules.enabled(featureSingleAssetVault)))
|
||||
|
||||
@@ -25,12 +25,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
MPTokenIssuanceDestroy::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureMPTokensV1);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
MPTokenIssuanceDestroy::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -29,9 +29,6 @@ namespace ripple {
|
||||
bool
|
||||
MPTokenIssuanceSet::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
if (!ctx.rules.enabled(featureMPTokensV1))
|
||||
return false;
|
||||
|
||||
return !ctx.tx.isFieldPresent(sfDomainID) ||
|
||||
(ctx.rules.enabled(featurePermissionedDomains) &&
|
||||
ctx.rules.enabled(featureSingleAssetVault));
|
||||
@@ -64,7 +61,6 @@ static constexpr std::array<MPTMutabilityFlags, 6> mptMutabilityFlags = {
|
||||
NotTEC
|
||||
MPTokenIssuanceSet::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
auto const mutableFlags = ctx.tx[~sfMutableFlags];
|
||||
auto const metadata = ctx.tx[~sfMPTokenMetadata];
|
||||
auto const transferFee = ctx.tx[~sfTransferFee];
|
||||
|
||||
@@ -27,12 +27,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
NFTokenAcceptOffer::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
NFTokenAcceptOffer::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -51,9 +51,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
NFTokenBurn::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
NFTokenBurn::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
NFTokenCancelOffer::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
NFTokenCancelOffer::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
NFTokenCreateOffer::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
NFTokenCreateOffer::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static std::uint32_t
|
||||
getFlagsMask(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -49,9 +49,6 @@ hasOfferFields(PreflightContext const& ctx)
|
||||
bool
|
||||
NFTokenMint::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
if (!ctx.rules.enabled(featureNonFungibleTokensV1))
|
||||
return false;
|
||||
|
||||
return ctx.rules.enabled(featureNFTokenMintOffer) || !hasOfferFields(ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ namespace ripple {
|
||||
bool
|
||||
NFTokenModify::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1_1) &&
|
||||
ctx.rules.enabled(featureDynamicNFT);
|
||||
return ctx.rules.enabled(featureNonFungibleTokensV1_1);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
bool
|
||||
PermissionedDomainDelete::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featurePermissionedDomains);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
PermissionedDomainDelete::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ namespace ripple {
|
||||
bool
|
||||
PermissionedDomainSet::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featurePermissionedDomains) &&
|
||||
ctx.rules.enabled(featureCredentials);
|
||||
return ctx.rules.enabled(featureCredentials);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
|
||||
@@ -36,12 +36,6 @@ tokenPairKey(STObject const& pair)
|
||||
pair.getFieldCurrency(sfQuoteAsset).currency());
|
||||
}
|
||||
|
||||
bool
|
||||
SetOracle::isEnabled(PreflightContext const& ctx)
|
||||
{
|
||||
return ctx.rules.enabled(featurePriceOracle);
|
||||
}
|
||||
|
||||
NotTEC
|
||||
SetOracle::preflight(PreflightContext const& ctx)
|
||||
{
|
||||
|
||||
@@ -42,9 +42,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
|
||||
@@ -203,7 +203,8 @@ public:
|
||||
/* Do NOT define an invokePreflight function in a derived class.
|
||||
Instead, define:
|
||||
|
||||
// Optional if the transaction is gated on an amendment
|
||||
// Optional if the transaction is gated on an amendment that
|
||||
// isn't specified in transactions.macro
|
||||
static bool
|
||||
isEnabled(PreflightContext const& ctx);
|
||||
|
||||
@@ -392,10 +393,6 @@ template <class T>
|
||||
NotTEC
|
||||
Transactor::invokePreflight(PreflightContext const& ctx)
|
||||
{
|
||||
// TODO: If #5650 is merged, use its transaction -> amendment lookup here to
|
||||
// do a first-pass check. Rewrite or remove any `isEnabled` overloads that
|
||||
// check those default amendments.
|
||||
|
||||
// Using this lookup does NOT require checking the fixDelegateV1_1. The data
|
||||
// exists regardless of whether it is enabled.
|
||||
auto const feature =
|
||||
|
||||
Reference in New Issue
Block a user