mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Minimize use of jtx::with_only_features (RIPD-1515):
In order to automatically run unit tests with newly created amendments, prefer to start with jtx::supported_features() and then subtract unwanted features. These changes identified a few bugs that were hiding in amendments. One of those bugs, in FlowCross, is not yet fixed. By uncommenting the test in CrossingLimits_test.cpp you can see failures relating to that bug. Since FlowCross is not yet enabled on the network we can fix the bug at our convenience.
This commit is contained in:
@@ -46,19 +46,23 @@ struct SetAuth_test : public beast::unit_test::suite
|
||||
return jv;
|
||||
}
|
||||
|
||||
void testAuth(std::initializer_list<uint256> fs)
|
||||
void testAuth(FeatureBitset features)
|
||||
{
|
||||
// featureTrustSetAuth should always be set by the caller.
|
||||
BEAST_EXPECT (hasFeature (featureTrustSetAuth, features));
|
||||
|
||||
using namespace jtx;
|
||||
auto const gw = Account("gw");
|
||||
auto const USD = gw["USD"];
|
||||
{
|
||||
Env env(*this, with_only_features(fs));
|
||||
Env env(*this, features & ~with_only_features(featureTrustSetAuth));
|
||||
env.fund(XRP(100000), "alice", gw);
|
||||
env(fset(gw, asfRequireAuth));
|
||||
env(auth(gw, "alice", "USD"), ter(tecNO_LINE_REDUNDANT));
|
||||
}
|
||||
{
|
||||
Env env(*this, with_only_features(featureTrustSetAuth));
|
||||
Env env(*this, features);
|
||||
|
||||
env.fund(XRP(100000), "alice", "bob", gw);
|
||||
env(fset(gw, asfRequireAuth));
|
||||
env(auth(gw, "alice", "USD"));
|
||||
@@ -75,10 +79,14 @@ struct SetAuth_test : public beast::unit_test::suite
|
||||
|
||||
void run() override
|
||||
{
|
||||
testAuth({});
|
||||
testAuth({featureFlow});
|
||||
testAuth({featureFlow, fix1373});
|
||||
testAuth({featureFlow, fix1373, featureFlowCross});
|
||||
using namespace jtx;
|
||||
testAuth(supported_features_except (
|
||||
featureFlow, fix1373, featureFlowCross));
|
||||
testAuth(supported_features_except (
|
||||
fix1373, featureFlowCross));
|
||||
testAuth(supported_features_except (
|
||||
featureFlowCross));
|
||||
testAuth(supported_amendments());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user