Unit tests don't enable Tickets or SHAMapV2 by default:

Both Tickets and SHAMapV2 have been around for a while and don't
look like they will be enabled on the network soon.  So they are
removed from the supportedAmendments list.  This prevents Env
from automatically testing with Tickets or SHAMapV2 enabled,
although testing with those features can still be explicitly
specified.

Drive-by cleanups:

o supportedAmendments() returns a const reference rather than
  a fresh vector on each call.

o supportedAmendments() implementation moved from Amendments.cpp
  to Feature.cpp.  Amendments.cpp deleted.

o supportedAmendments() declared in Feature.h.  All other
  declarations deleted.

o preEnabledAmendments() removed, since it was empty and only
  used in one place.  It will be easy to re-add when it is needed.

o jtx::all_features_except() renamed to
  jtx::supported_features_except(), which is more descriptive.

o jtx::all_amendments() renamed to jxt::supported_amendments()

o jtx::with_features() renamed to with_only_features()

o Env_test.cpp adjusted since featureTickets is no longer
  automatically enabled for unit tests.
This commit is contained in:
Scott Schurr
2017-08-03 16:26:40 -07:00
committed by seelabs
parent 07e3f81b76
commit feb7582aca
34 changed files with 282 additions and 345 deletions

View File

@@ -116,7 +116,7 @@ class Feature_test : public beast::unit_test::suite
using namespace test::jtx;
Env env {*this,
with_features(featureEscrow, featureCryptoConditions)};
with_only_features(featureEscrow, featureCryptoConditions)};
// The amendment table has to be modified
// since that is what feature RPC actually checks
env.app().getAmendmentTable().enable(featureEscrow);
@@ -220,7 +220,7 @@ class Feature_test : public beast::unit_test::suite
using namespace test::jtx;
Env env {*this,
with_features(featureCryptoConditions)};
with_only_features(featureCryptoConditions)};
// The amendment table has to be modified
// since that is what feature RPC actually checks
env.app().getAmendmentTable().enable(featureCryptoConditions);