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:
Scott Schurr
2017-08-16 18:30:55 -07:00
committed by seelabs
parent aa76632bb3
commit 3523cee63d
30 changed files with 826 additions and 658 deletions

View File

@@ -39,7 +39,7 @@ public:
void test_noReserve()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
// Pay alice enough to meet the initial reserve, but not enough to
@@ -87,7 +87,7 @@ public:
void test_signerListSet()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
@@ -132,7 +132,7 @@ public:
void test_phantomSigners()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
env.close();
@@ -233,7 +233,7 @@ public:
void test_fee ()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
env.close();
@@ -283,7 +283,7 @@ public:
void test_misorderedSigners()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
env.close();
@@ -305,7 +305,7 @@ public:
void test_masterSigners()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
Account const becky {"becky", KeyType::secp256k1};
Account const cheri {"cheri", KeyType::ed25519};
@@ -357,7 +357,7 @@ public:
void test_regularSigners()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
Account const becky {"becky", KeyType::ed25519};
Account const cheri {"cheri", KeyType::secp256k1};
@@ -415,7 +415,7 @@ public:
void test_regularSignersUsingSubmitMulti()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
Account const becky {"becky", KeyType::ed25519};
Account const cheri {"cheri", KeyType::secp256k1};
@@ -618,7 +618,7 @@ public:
void test_heterogeneousSigners()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
Account const becky {"becky", KeyType::ed25519};
Account const cheri {"cheri", KeyType::secp256k1};
@@ -733,7 +733,7 @@ public:
void test_keyDisable()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
@@ -808,7 +808,7 @@ public:
void test_regKey()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
env.fund(XRP(1000), alice);
@@ -840,7 +840,7 @@ public:
void test_txTypes()
{
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
Account const alice {"alice", KeyType::secp256k1};
Account const becky {"becky", KeyType::ed25519};
Account const zelda {"zelda", KeyType::secp256k1};
@@ -924,7 +924,7 @@ public:
// Verify that the text returned for signature failures is correct.
using namespace jtx;
Env env(*this, with_only_features(featureMultiSign));
Env env(*this);
// lambda that submits an STTx and returns the resulting JSON.
auto submitSTTx = [&env] (STTx const& stx)
@@ -1058,7 +1058,7 @@ public:
void test_noMultiSigners()
{
using namespace jtx;
Env env {*this, with_only_features(featureMultiSign)};
Env env {*this};
Account const alice {"alice", KeyType::ed25519};
Account const becky {"becky", KeyType::secp256k1};
env.fund(XRP(1000), alice, becky);