New rules for payment paths:

* Sanity check on newly created strands
* Better loop detection
* Better tests (test every combination of path element pairs)
* Disallow any root issuer (even for xrp)
* Disallow compount element typs in path
* Issue was not reset when currency was XRP
* Add amendment
This commit is contained in:
seelabs
2017-02-08 13:24:36 -05:00
committed by Scott Schurr
parent 80d9b0464a
commit 846723d771
27 changed files with 2172 additions and 646 deletions

View File

@@ -24,6 +24,7 @@
#include <ripple/beast/unit_test.h>
#include <ripple/beast/core/LexicalCast.h>
#include <ripple/protocol/JsonFields.h>
#include <ripple/protocol/Feature.h>
#include <ripple/protocol/SField.h>
namespace ripple {
@@ -36,11 +37,11 @@ class Discrepancy_test : public beast::unit_test::suite
// A payment with path and sendmax is made and the transaction is queried
// to verify that the net of balance changes match the fee charged.
void
testXRPDiscrepancy ()
testXRPDiscrepancy (std::initializer_list<uint256> fs)
{
testcase ("Discrepancy test : XRP Discrepancy");
using namespace test::jtx;
Env env {*this};
Env env {*this, features(fs)};
Account A1 {"A1"};
Account A2 {"A2"};
@@ -143,7 +144,9 @@ class Discrepancy_test : public beast::unit_test::suite
public:
void run ()
{
testXRPDiscrepancy ();
testXRPDiscrepancy ({});
testXRPDiscrepancy ({featureFlow});
testXRPDiscrepancy ({featureFlow, featureToStrandV2});
}
};