mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 03:55:53 +00:00
Remove conditionals for featureTrustSetAuth enabled 19Jul2016
This commit is contained in:
committed by
Manoj doshi
parent
6e4945c56b
commit
51ed7db002
@@ -444,7 +444,7 @@ SetTrust::doApply ()
|
|||||||
else if (! saLimitAmount && // Setting default limit.
|
else if (! saLimitAmount && // Setting default limit.
|
||||||
(! bQualityIn || ! uQualityIn) && // Not setting quality in or setting default quality in.
|
(! bQualityIn || ! uQualityIn) && // Not setting quality in or setting default quality in.
|
||||||
(! bQualityOut || ! uQualityOut) && // Not setting quality out or setting default quality out.
|
(! bQualityOut || ! uQualityOut) && // Not setting quality out or setting default quality out.
|
||||||
(! (view().rules().enabled(featureTrustSetAuth)) || ! bSetAuth))
|
(! bSetAuth))
|
||||||
{
|
{
|
||||||
JLOG(j_.trace()) <<
|
JLOG(j_.trace()) <<
|
||||||
"Redundant: Setting non-existent ripple line to defaults.";
|
"Redundant: Setting non-existent ripple line to defaults.";
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class FeatureCollections
|
|||||||
{
|
{
|
||||||
"MultiSign", // Unconditionally supported.
|
"MultiSign", // Unconditionally supported.
|
||||||
"Tickets",
|
"Tickets",
|
||||||
"TrustSetAuth",
|
"TrustSetAuth", // Unconditionally supported.
|
||||||
"FeeEscalation", // Unconditionally supported.
|
"FeeEscalation", // Unconditionally supported.
|
||||||
"OwnerPaysFee",
|
"OwnerPaysFee",
|
||||||
"CompareFlowV1V2",
|
"CompareFlowV1V2",
|
||||||
@@ -340,7 +340,6 @@ foreachFeature(FeatureBitset bs, F&& f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern uint256 const featureTickets;
|
extern uint256 const featureTickets;
|
||||||
extern uint256 const featureTrustSetAuth;
|
|
||||||
extern uint256 const featureOwnerPaysFee;
|
extern uint256 const featureOwnerPaysFee;
|
||||||
extern uint256 const featureCompareFlowV1V2;
|
extern uint256 const featureCompareFlowV1V2;
|
||||||
extern uint256 const featurePayChan;
|
extern uint256 const featurePayChan;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ detail::supportedAmendments ()
|
|||||||
{
|
{
|
||||||
"MultiSign", // Unconditionally supported.
|
"MultiSign", // Unconditionally supported.
|
||||||
// "Tickets",
|
// "Tickets",
|
||||||
"TrustSetAuth",
|
"TrustSetAuth", // Unconditionally supported.
|
||||||
"FeeEscalation", // Unconditionally supported.
|
"FeeEscalation", // Unconditionally supported.
|
||||||
// "OwnerPaysFee",
|
// "OwnerPaysFee",
|
||||||
"PayChan",
|
"PayChan",
|
||||||
@@ -152,7 +152,6 @@ uint256 bitsetIndexToFeature(size_t i)
|
|||||||
|
|
||||||
|
|
||||||
uint256 const featureTickets = *getRegisteredFeature("Tickets");
|
uint256 const featureTickets = *getRegisteredFeature("Tickets");
|
||||||
uint256 const featureTrustSetAuth = *getRegisteredFeature("TrustSetAuth");
|
|
||||||
uint256 const featureOwnerPaysFee = *getRegisteredFeature("OwnerPaysFee");
|
uint256 const featureOwnerPaysFee = *getRegisteredFeature("OwnerPaysFee");
|
||||||
uint256 const featureCompareFlowV1V2 = *getRegisteredFeature("CompareFlowV1V2");
|
uint256 const featureCompareFlowV1V2 = *getRegisteredFeature("CompareFlowV1V2");
|
||||||
uint256 const featurePayChan = *getRegisteredFeature("PayChan");
|
uint256 const featurePayChan = *getRegisteredFeature("PayChan");
|
||||||
|
|||||||
@@ -47,43 +47,33 @@ struct SetAuth_test : public beast::unit_test::suite
|
|||||||
|
|
||||||
void testAuth(FeatureBitset features)
|
void testAuth(FeatureBitset features)
|
||||||
{
|
{
|
||||||
// featureTrustSetAuth should always be reset by the caller.
|
|
||||||
BEAST_EXPECT(!features[featureTrustSetAuth]);
|
|
||||||
|
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
auto const gw = Account("gw");
|
auto const gw = Account("gw");
|
||||||
auto const USD = gw["USD"];
|
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 env(*this);
|
||||||
env(fset(gw, asfRequireAuth));
|
|
||||||
env(auth(gw, "alice", "USD"));
|
env.fund(XRP(100000), "alice", "bob", gw);
|
||||||
BEAST_EXPECT(env.le(
|
env(fset(gw, asfRequireAuth));
|
||||||
keylet::line(Account("alice").id(),
|
env(auth(gw, "alice", "USD"));
|
||||||
gw.id(), USD.currency)));
|
BEAST_EXPECT(env.le(
|
||||||
env(trust("alice", USD(1000)));
|
keylet::line(Account("alice").id(),
|
||||||
env(trust("bob", USD(1000)));
|
gw.id(), USD.currency)));
|
||||||
env(pay(gw, "alice", USD(100)));
|
env(trust("alice", USD(1000)));
|
||||||
env(pay(gw, "bob", USD(100)), ter(tecPATH_DRY)); // Should be terNO_AUTH
|
env(trust("bob", USD(1000)));
|
||||||
env(pay("alice", "bob", USD(50)), ter(tecPATH_DRY)); // Should be terNO_AUTH
|
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
|
void run() override
|
||||||
{
|
{
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
auto const sa = supported_amendments();
|
auto const sa = supported_amendments();
|
||||||
testAuth(sa - featureTrustSetAuth - featureFlow - fix1373 - featureFlowCross);
|
testAuth(sa - featureFlow - fix1373 - featureFlowCross);
|
||||||
testAuth(sa - featureTrustSetAuth - fix1373 - featureFlowCross);
|
testAuth(sa - fix1373 - featureFlowCross);
|
||||||
testAuth(sa - featureTrustSetAuth - featureFlowCross);
|
testAuth(sa - featureFlowCross);
|
||||||
testAuth(sa - featureTrustSetAuth);
|
testAuth(sa);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user