mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove conditionals for featureEscrow enabled 31Mar2017
This commit is contained in:
@@ -215,36 +215,25 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
using namespace jtx;
|
||||
using namespace std::chrono;
|
||||
|
||||
{ // Escrow not enabled
|
||||
Env env(*this, supported_amendments() - featureEscrow);
|
||||
env.fund(XRP(5000), "alice", "bob");
|
||||
env(escrow("alice", "bob", XRP(1000)),
|
||||
finish_time(env.now() + 1s), ter(temDISABLED));
|
||||
env(finish("bob", "alice", 1), ter(temDISABLED));
|
||||
env(cancel("bob", "alice", 1), ter(temDISABLED));
|
||||
}
|
||||
Env env(*this);
|
||||
env.fund(XRP(5000), "alice", "bob");
|
||||
env(escrow("alice", "bob", XRP(1000)), finish_time(env.now() + 1s));
|
||||
env.close();
|
||||
|
||||
{ // Escrow enabled
|
||||
Env env(*this);
|
||||
env.fund(XRP(5000), "alice", "bob");
|
||||
env(escrow("alice", "bob", XRP(1000)), finish_time(env.now() + 1s));
|
||||
env.close();
|
||||
auto const seq1 = env.seq("alice");
|
||||
|
||||
auto const seq1 = env.seq("alice");
|
||||
env(escrow("alice", "bob", XRP(1000)), condition (cb1),
|
||||
finish_time(env.now() + 1s), fee(1500));
|
||||
env.close();
|
||||
env(finish("bob", "alice", seq1),
|
||||
condition(cb1), fulfillment(fb1), fee(1500));
|
||||
|
||||
env(escrow("alice", "bob", XRP(1000)), condition (cb1),
|
||||
finish_time(env.now() + 1s), fee(1500));
|
||||
env.close();
|
||||
env(finish("bob", "alice", seq1),
|
||||
condition(cb1), fulfillment(fb1), fee(1500));
|
||||
auto const seq2 = env.seq("alice");
|
||||
|
||||
auto const seq2 = env.seq("alice");
|
||||
|
||||
env(escrow("alice", "bob", XRP(1000)), condition(cb2),
|
||||
finish_time(env.now() + 1s), cancel_time(env.now() + 2s), fee(1500));
|
||||
env.close();
|
||||
env(cancel("bob", "alice", seq2), fee(1500));
|
||||
}
|
||||
env(escrow("alice", "bob", XRP(1000)), condition(cb2),
|
||||
finish_time(env.now() + 1s), cancel_time(env.now() + 2s), fee(1500));
|
||||
env.close();
|
||||
env(cancel("bob", "alice", seq2), fee(1500));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user