Remove conditionals for featureEscrow enabled 31Mar2017

This commit is contained in:
Scott Schurr
2020-02-27 15:31:13 -08:00
parent e93a44fe9b
commit c8282795ef
5 changed files with 28 additions and 47 deletions

View File

@@ -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));
});
}