diff --git a/src/ripple/app/tx/impl/Escrow.cpp b/src/ripple/app/tx/impl/Escrow.cpp index 2af6d57cf..0fb9b0250 100644 --- a/src/ripple/app/tx/impl/Escrow.cpp +++ b/src/ripple/app/tx/impl/Escrow.cpp @@ -98,9 +98,6 @@ EscrowCreate::calculateMaxSpend(STTx const& tx) NotTEC EscrowCreate::preflight (PreflightContext const& ctx) { - if (! ctx.rules.enabled(featureEscrow)) - return temDISABLED; - if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) return temINVALID_FLAG; @@ -300,9 +297,6 @@ checkCondition (Slice f, Slice c) NotTEC EscrowFinish::preflight (PreflightContext const& ctx) { - if (! ctx.rules.enabled(featureEscrow)) - return temDISABLED; - if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) return temINVALID_FLAG; @@ -518,9 +512,6 @@ EscrowFinish::doApply() NotTEC EscrowCancel::preflight (PreflightContext const& ctx) { - if (! ctx.rules.enabled(featureEscrow)) - return temDISABLED; - if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) return temINVALID_FLAG; diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 4da45fa99..25f333421 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -372,7 +372,7 @@ extern uint256 const featureFlowCross; extern uint256 const retiredCryptoConditions; extern uint256 const retiredTickSize; extern uint256 const retiredFix1368; -extern uint256 const featureEscrow; +extern uint256 const retiredEscrow; extern uint256 const featureCryptoConditionsSuite; extern uint256 const fix1373; extern uint256 const featureEnforceInvariants; diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 396a8a181..e58bd5832 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -163,7 +163,7 @@ uint256 const featureFlowCross = *getRegisteredFeature("FlowCross"); uint256 const retiredCryptoConditions = *getRegisteredFeature("CryptoConditions"); uint256 const retiredTickSize = *getRegisteredFeature("TickSize"); uint256 const retiredFix1368 = *getRegisteredFeature("fix1368"); -uint256 const featureEscrow = *getRegisteredFeature("Escrow"); +uint256 const retiredEscrow = *getRegisteredFeature("Escrow"); uint256 const featureCryptoConditionsSuite = *getRegisteredFeature("CryptoConditionsSuite"); uint256 const fix1373 = *getRegisteredFeature("fix1373"); uint256 const featureEnforceInvariants = *getRegisteredFeature("EnforceInvariants"); diff --git a/src/test/app/Escrow_test.cpp b/src/test/app/Escrow_test.cpp index c323abf75..84ec7f7eb 100644 --- a/src/test/app/Escrow_test.cpp +++ b/src/test/app/Escrow_test.cpp @@ -215,36 +215,25 @@ struct Escrow_test : public beast::unit_test::suite using namespace jtx; using namespace std::chrono; - { // Escrow not enabled - Env env(*this, supported_amendments() - featureEscrow); - env.fund(XRP(5000), "alice", "bob"); - env(escrow("alice", "bob", XRP(1000)), - finish_time(env.now() + 1s), ter(temDISABLED)); - env(finish("bob", "alice", 1), ter(temDISABLED)); - env(cancel("bob", "alice", 1), ter(temDISABLED)); - } + Env env(*this); + env.fund(XRP(5000), "alice", "bob"); + env(escrow("alice", "bob", XRP(1000)), finish_time(env.now() + 1s)); + env.close(); - { // Escrow enabled - Env env(*this); - env.fund(XRP(5000), "alice", "bob"); - env(escrow("alice", "bob", XRP(1000)), finish_time(env.now() + 1s)); - env.close(); + auto const seq1 = env.seq("alice"); - auto const seq1 = env.seq("alice"); + env(escrow("alice", "bob", XRP(1000)), condition (cb1), + finish_time(env.now() + 1s), fee(1500)); + env.close(); + env(finish("bob", "alice", seq1), + condition(cb1), fulfillment(fb1), fee(1500)); - env(escrow("alice", "bob", XRP(1000)), condition (cb1), - finish_time(env.now() + 1s), fee(1500)); - env.close(); - env(finish("bob", "alice", seq1), - condition(cb1), fulfillment(fb1), fee(1500)); + auto const seq2 = env.seq("alice"); - auto const seq2 = env.seq("alice"); - - env(escrow("alice", "bob", XRP(1000)), condition(cb2), - finish_time(env.now() + 1s), cancel_time(env.now() + 2s), fee(1500)); - env.close(); - env(cancel("bob", "alice", seq2), fee(1500)); - } + env(escrow("alice", "bob", XRP(1000)), condition(cb2), + finish_time(env.now() + 1s), cancel_time(env.now() + 2s), fee(1500)); + env.close(); + env(cancel("bob", "alice", seq2), fee(1500)); } void diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index 2ea9a335a..b3c2c7811 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -748,23 +748,23 @@ public: { // a Env FeatureBitset has *only* those features - Env env{*this, FeatureBitset(featureEscrow, featureFlow)}; + Env env{*this, FeatureBitset(featureMultiSignReserve, featureFlow)}; BEAST_EXPECT(env.app().config().features.size() == 2); foreachFeature(supported, [&](uint256 const& f) { - bool const has = (f == featureEscrow || f == featureFlow); + bool const has = (f == featureMultiSignReserve || f == featureFlow); this->BEAST_EXPECT(has == hasFeature(env, f)); }); } - auto const noFlowOrEscrow = - supported_amendments() - featureEscrow - featureFlow; + auto const missingSomeFeatures = + supported_amendments() - featureMultiSignReserve - featureFlow; { // a Env supported_features_except is missing *only* those features - Env env{*this, noFlowOrEscrow}; + Env env{*this, missingSomeFeatures}; BEAST_EXPECT( env.app().config().features.size() == (supported.count() - 2)); foreachFeature(supported, [&](uint256 const& f) { - bool hasnot = (f == featureEscrow || f == featureFlow); + bool hasnot = (f == featureMultiSignReserve || f == featureFlow); this->BEAST_EXPECT(hasnot != hasFeature(env, f)); }); } @@ -776,7 +776,8 @@ public: // the two supported ones Env env{ *this, - FeatureBitset(featureEscrow, featureFlow, *neverSupportedFeat)}; + FeatureBitset( + featureMultiSignReserve, featureFlow, *neverSupportedFeat)}; // this app will have just 2 supported amendments and // one additional never supported feature flag @@ -784,7 +785,7 @@ public: BEAST_EXPECT(hasFeature(env, *neverSupportedFeat)); foreachFeature(supported, [&](uint256 const& f) { - bool has = (f == featureEscrow || f == featureFlow); + bool has = (f == featureMultiSignReserve || f == featureFlow); this->BEAST_EXPECT(has == hasFeature(env, f)); }); } @@ -794,7 +795,7 @@ public: // and omit a few standard amendments // the unsupported features should be enabled Env env{*this, - noFlowOrEscrow | FeatureBitset{*neverSupportedFeat}}; + missingSomeFeatures | FeatureBitset{*neverSupportedFeat}}; // this app will have all supported amendments minus 2 and then the // one additional never supported feature flag @@ -803,7 +804,7 @@ public: (supported.count() - 2 + 1)); BEAST_EXPECT(hasFeature(env, *neverSupportedFeat)); foreachFeature(supported, [&](uint256 const& f) { - bool hasnot = (f == featureEscrow || f == featureFlow); + bool hasnot = (f == featureMultiSignReserve || f == featureFlow); this->BEAST_EXPECT(hasnot != hasFeature(env, f)); }); }