mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
refactor: Retire CryptoConditionsSuite amendment (#6036)
Amendments activated for more than 2 years can be retired. This change retires the CryptoConditionsSuite amendment.
This commit is contained in:
@@ -79,9 +79,9 @@ XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYe
|
||||
// enabled (added to the ledger).
|
||||
//
|
||||
// If a feature remains obsolete for long enough that no clients are able
|
||||
// to vote for it, the feature can be removed (entirely?) from the code.
|
||||
XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete)
|
||||
|
||||
// to vote for it, the feature can be removed entirely from the code. Until
|
||||
// then the feature needs to be marked explicitly as obsolete, e.g.
|
||||
// XRPL_FEATURE(Example, Supported::yes, VoteBehavior::Obsolete)
|
||||
// The following amendments have been active for at least two years. Their
|
||||
// pre-amendment code has been removed and the identifiers are deprecated.
|
||||
// All known amendments and amendments that may appear in a validated ledger
|
||||
@@ -117,6 +117,7 @@ XRPL_RETIRE_FIX(TrustLinesToSelf)
|
||||
XRPL_RETIRE_FEATURE(Checks)
|
||||
XRPL_RETIRE_FEATURE(CheckCashMakesTrustLine)
|
||||
XRPL_RETIRE_FEATURE(CryptoConditions)
|
||||
XRPL_RETIRE_FEATURE(CryptoConditionsSuite)
|
||||
XRPL_RETIRE_FEATURE(DepositAuth)
|
||||
XRPL_RETIRE_FEATURE(DepositPreauth)
|
||||
XRPL_RETIRE_FEATURE(DisallowIncoming)
|
||||
|
||||
@@ -529,7 +529,22 @@ class Feature_test : public beast::unit_test::suite
|
||||
|
||||
using namespace test::jtx;
|
||||
Env env{*this};
|
||||
constexpr char const* featureName = "CryptoConditionsSuite";
|
||||
|
||||
auto const& supportedAmendments = detail::supportedAmendments();
|
||||
auto obsoleteFeature = std::find_if(
|
||||
std::begin(supportedAmendments),
|
||||
std::end(supportedAmendments),
|
||||
[](auto const& pair) {
|
||||
return pair.second == VoteBehavior::Obsolete;
|
||||
});
|
||||
|
||||
if (obsoleteFeature == std::end(supportedAmendments))
|
||||
{
|
||||
pass();
|
||||
return;
|
||||
}
|
||||
|
||||
auto const featureName = obsoleteFeature->first;
|
||||
|
||||
auto jrr = env.rpc("feature", featureName)[jss::result];
|
||||
if (!BEAST_EXPECTS(jrr[jss::status] == jss::success, "status"))
|
||||
|
||||
@@ -153,12 +153,6 @@ EscrowCreate::preflight(PreflightContext const& ctx)
|
||||
<< ec.message();
|
||||
return temMALFORMED;
|
||||
}
|
||||
|
||||
// Conditions other than PrefixSha256 require the
|
||||
// "CryptoConditionsSuite" amendment:
|
||||
if (condition->type != Type::preimageSha256 &&
|
||||
!ctx.rules.enabled(featureCryptoConditionsSuite))
|
||||
return temDISABLED;
|
||||
}
|
||||
|
||||
return tesSUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user