From 51ed7db0027ba822739bd9de6f2613f97c1b227b Mon Sep 17 00:00:00 2001 From: Scott Schurr Date: Wed, 15 Jan 2020 17:23:59 -0800 Subject: [PATCH] Remove conditionals for featureTrustSetAuth enabled 19Jul2016 --- src/ripple/app/tx/impl/SetTrust.cpp | 2 +- src/ripple/protocol/Feature.h | 3 +- src/ripple/protocol/impl/Feature.cpp | 3 +- src/test/app/SetAuth_test.cpp | 44 +++++++++++----------------- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/src/ripple/app/tx/impl/SetTrust.cpp b/src/ripple/app/tx/impl/SetTrust.cpp index e1e11d233d2..da002f5ad38 100644 --- a/src/ripple/app/tx/impl/SetTrust.cpp +++ b/src/ripple/app/tx/impl/SetTrust.cpp @@ -444,7 +444,7 @@ SetTrust::doApply () else if (! saLimitAmount && // Setting default limit. (! bQualityIn || ! uQualityIn) && // Not setting quality in or setting default quality in. (! bQualityOut || ! uQualityOut) && // Not setting quality out or setting default quality out. - (! (view().rules().enabled(featureTrustSetAuth)) || ! bSetAuth)) + (! bSetAuth)) { JLOG(j_.trace()) << "Redundant: Setting non-existent ripple line to defaults."; diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 66b95e3530d..4a397dbe61b 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -52,7 +52,7 @@ class FeatureCollections { "MultiSign", // Unconditionally supported. "Tickets", - "TrustSetAuth", + "TrustSetAuth", // Unconditionally supported. "FeeEscalation", // Unconditionally supported. "OwnerPaysFee", "CompareFlowV1V2", @@ -340,7 +340,6 @@ foreachFeature(FeatureBitset bs, F&& f) } extern uint256 const featureTickets; -extern uint256 const featureTrustSetAuth; extern uint256 const featureOwnerPaysFee; extern uint256 const featureCompareFlowV1V2; extern uint256 const featurePayChan; diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 6f0c51fdbf4..1cf8bb57207 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -94,7 +94,7 @@ detail::supportedAmendments () { "MultiSign", // Unconditionally supported. // "Tickets", - "TrustSetAuth", + "TrustSetAuth", // Unconditionally supported. "FeeEscalation", // Unconditionally supported. // "OwnerPaysFee", "PayChan", @@ -152,7 +152,6 @@ uint256 bitsetIndexToFeature(size_t i) uint256 const featureTickets = *getRegisteredFeature("Tickets"); -uint256 const featureTrustSetAuth = *getRegisteredFeature("TrustSetAuth"); uint256 const featureOwnerPaysFee = *getRegisteredFeature("OwnerPaysFee"); uint256 const featureCompareFlowV1V2 = *getRegisteredFeature("CompareFlowV1V2"); uint256 const featurePayChan = *getRegisteredFeature("PayChan"); diff --git a/src/test/app/SetAuth_test.cpp b/src/test/app/SetAuth_test.cpp index ff89073e2cf..4eb1b0d266b 100644 --- a/src/test/app/SetAuth_test.cpp +++ b/src/test/app/SetAuth_test.cpp @@ -47,43 +47,33 @@ struct SetAuth_test : public beast::unit_test::suite void testAuth(FeatureBitset features) { - // featureTrustSetAuth should always be reset by the caller. - BEAST_EXPECT(!features[featureTrustSetAuth]); - using namespace jtx; auto const gw = Account("gw"); auto const USD = gw["USD"]; - { - Env env(*this, features); - env.fund(XRP(100000), "alice", gw); - env(fset(gw, asfRequireAuth)); - env(auth(gw, "alice", "USD"), ter(tecNO_LINE_REDUNDANT)); - } - { - Env env(*this, features | featureTrustSetAuth); - env.fund(XRP(100000), "alice", "bob", gw); - env(fset(gw, asfRequireAuth)); - env(auth(gw, "alice", "USD")); - BEAST_EXPECT(env.le( - keylet::line(Account("alice").id(), - gw.id(), USD.currency))); - env(trust("alice", USD(1000))); - env(trust("bob", USD(1000))); - env(pay(gw, "alice", USD(100))); - env(pay(gw, "bob", USD(100)), ter(tecPATH_DRY)); // Should be terNO_AUTH - env(pay("alice", "bob", USD(50)), ter(tecPATH_DRY)); // Should be terNO_AUTH - } + Env env(*this); + + env.fund(XRP(100000), "alice", "bob", gw); + env(fset(gw, asfRequireAuth)); + env(auth(gw, "alice", "USD")); + BEAST_EXPECT(env.le( + keylet::line(Account("alice").id(), + gw.id(), USD.currency))); + env(trust("alice", USD(1000))); + env(trust("bob", USD(1000))); + env(pay(gw, "alice", USD(100))); + env(pay(gw, "bob", USD(100)), ter(tecPATH_DRY)); // Should be terNO_AUTH + env(pay("alice", "bob", USD(50)), ter(tecPATH_DRY)); // Should be terNO_AUTH } void run() override { using namespace jtx; auto const sa = supported_amendments(); - testAuth(sa - featureTrustSetAuth - featureFlow - fix1373 - featureFlowCross); - testAuth(sa - featureTrustSetAuth - fix1373 - featureFlowCross); - testAuth(sa - featureTrustSetAuth - featureFlowCross); - testAuth(sa - featureTrustSetAuth); + testAuth(sa - featureFlow - fix1373 - featureFlowCross); + testAuth(sa - fix1373 - featureFlowCross); + testAuth(sa - featureFlowCross); + testAuth(sa); } };