Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove time based switches #3212

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Always enable fix1449 dated March 30, 2017 20:00:00 UTC
scottschurr committed Jan 14, 2020
commit 3aacbb5c104873b657bdbc8e2242cdbfad743eeb
3 changes: 1 addition & 2 deletions src/ripple/app/paths/impl/DirectStep.cpp
Original file line number Diff line number Diff line change
@@ -425,8 +425,7 @@ DirectIPaymentStep::check (
return terNO_AUTH;
}

if (ctx.prevStep &&
fix1449(ctx.view.info().parentCloseTime))
if (ctx.prevStep)
{
if (ctx.prevStep->bookStepBook())
{
3 changes: 0 additions & 3 deletions src/ripple/ledger/View.h
Original file line number Diff line number Diff line change
@@ -328,9 +328,6 @@ transferXRP (ApplyView& view,
STAmount const& amount,
beast::Journal j);

[[nodiscard]] NetClock::time_point const& fix1449Time ();
[[nodiscard]] bool fix1449 (NetClock::time_point const closeTime);

} // ripple

#endif
14 changes: 0 additions & 14 deletions src/ripple/ledger/impl/View.cpp
Original file line number Diff line number Diff line change
@@ -33,20 +33,6 @@

namespace ripple {

NetClock::time_point const& fix1449Time ()
{
using namespace std::chrono_literals;
// Thurs, Mar 30, 2017 20:00:00 UTC
static NetClock::time_point const soTime{544219200s};

return soTime;
}

bool fix1449 (NetClock::time_point const closeTime)
{
return closeTime > fix1449Time();
}

//------------------------------------------------------------------------------
//
// Observers
46 changes: 0 additions & 46 deletions src/test/app/Check_test.cpp
Original file line number Diff line number Diff line change
@@ -166,9 +166,6 @@ class Check_test : public beast::unit_test::suite
// If the Checks amendment is not enabled, you should not be able
// to create, cash, or cancel checks.
Env env {*this, supported_amendments() - featureChecks};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), alice);

@@ -189,9 +186,6 @@ class Check_test : public beast::unit_test::suite
// If the Checks amendment is enabled all check-related
// facilities should be available.
Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), alice);

@@ -226,9 +220,6 @@ class Check_test : public beast::unit_test::suite
IOU const USD {gw["USD"]};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

STAmount const startBalance {XRP(1000).value()};
env.fund (startBalance, gw, alice, bob);
@@ -327,9 +318,6 @@ class Check_test : public beast::unit_test::suite
IOU const USD {gw1["USD"]};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

STAmount const startBalance {XRP(1000).value()};
env.fund (startBalance, gw1, gwF, alice, bob);
@@ -507,9 +495,6 @@ class Check_test : public beast::unit_test::suite
Account const bob {"bob"};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

XRPAmount const baseFeeDrops {env.current()->fees().base};
STAmount const startBalance {XRP(300).value()};
@@ -632,9 +617,6 @@ class Check_test : public beast::unit_test::suite
{
// Simple IOU check cashed with Amount (with failures).
Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);

@@ -754,9 +736,6 @@ class Check_test : public beast::unit_test::suite
{
// Simple IOU check cashed with DeliverMin (with failures).
Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);

@@ -840,9 +819,6 @@ class Check_test : public beast::unit_test::suite
{
// Examine the effects of the asfRequireAuth flag.
Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);
env (fset (gw, asfRequireAuth));
@@ -900,9 +876,6 @@ class Check_test : public beast::unit_test::suite
allSupported | featureMultiSignReserve})
{
Env env {*this, features};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);

@@ -973,9 +946,6 @@ class Check_test : public beast::unit_test::suite
IOU const USD {gw["USD"]};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);

@@ -1045,9 +1015,6 @@ class Check_test : public beast::unit_test::suite
IOU const USD {gw["USD"]};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob);

@@ -1245,9 +1212,6 @@ class Check_test : public beast::unit_test::suite
IOU const USD {gw["USD"]};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob, zoe);

@@ -1550,10 +1514,6 @@ class Check_test : public beast::unit_test::suite
{
Env env {*this, features};

auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), gw, alice, bob, zoe);

// alice creates her checks ahead of time.
@@ -1708,9 +1668,6 @@ class Check_test : public beast::unit_test::suite
Account const bob {"bob"};

Env env {*this};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), alice, bob);

@@ -1745,9 +1702,6 @@ class Check_test : public beast::unit_test::suite
Account const bob {"bob"};

Env env {*this, features};
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

env.fund (XRP(1000), alice, bob);
env.close();
25 changes: 0 additions & 25 deletions src/test/app/CrossingLimits_test.cpp
Original file line number Diff line number Diff line change
@@ -52,10 +52,6 @@ class CrossingLimits_test : public beast::unit_test::suite

using namespace jtx;
Env env(*this, features);
auto const closeTime =
fix1449Time() +
100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

auto const gw = Account("gateway");
auto const USD = gw["USD"];
@@ -96,10 +92,6 @@ class CrossingLimits_test : public beast::unit_test::suite

using namespace jtx;
Env env(*this, features);
auto const closeTime =
fix1449Time() +
100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

auto const gw = Account("gateway");
auto const USD = gw["USD"];
@@ -140,10 +132,6 @@ class CrossingLimits_test : public beast::unit_test::suite

using namespace jtx;
Env env(*this, features);
auto const closeTime =
fix1449Time() +
100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

auto const gw = Account("gateway");
auto const USD = gw["USD"];
@@ -208,10 +196,6 @@ class CrossingLimits_test : public beast::unit_test::suite

using namespace jtx;
Env env(*this, features);
auto const closeTime =
fix1449Time() +
100 * env.closed()->info().closeTimeResolution;
env.close (closeTime);

auto const gw = Account("gateway");
auto const USD = gw["USD"];
@@ -329,9 +313,6 @@ class CrossingLimits_test : public beast::unit_test::suite
// strand dry until the liquidity is actually used)
{
Env env(*this, features);
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close(closeTime);

env.fund(XRP(100000000), gw, alice, bob, carol);

@@ -400,9 +381,6 @@ class CrossingLimits_test : public beast::unit_test::suite
}
{
Env env(*this, features);
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close(closeTime);

env.fund(XRP(100000000), gw, alice, bob, carol);

@@ -508,9 +486,6 @@ class CrossingLimits_test : public beast::unit_test::suite
auto const USD = gw["USD"];

Env env(*this, features);
auto const closeTime =
fix1449Time() + 100 * env.closed()->info().closeTimeResolution;
env.close(closeTime);

env.fund(XRP(100000000), gw, alice, bob);

11 changes: 3 additions & 8 deletions src/test/app/Flow_test.cpp
Original file line number Diff line number Diff line change
@@ -1090,16 +1090,12 @@ struct Flow_test : public beast::unit_test::suite
}

void
testRIPD1449(bool withFix)
testRIPD1449()
{
testcase("ripd1449");

using namespace jtx;
Env env(*this);
auto const timeDelta = env.closed ()->info ().closeTimeResolution;
auto const d = withFix ? 100*timeDelta : -100*timeDelta;
auto closeTime = fix1449Time() + d;
env.close(closeTime);

// pay alice -> xrp -> USD/bob -> bob -> gw -> alice
// set no ripple on bob's side of the bob/gw trust line
@@ -1128,7 +1124,7 @@ struct Flow_test : public beast::unit_test::suite

env(pay(alice, alice, USD(1000)), path(~bob["USD"], bob, gw),
sendmax(XRP(1)), txflags(tfNoRippleDirect),
ter(withFix ? TER {tecPATH_DRY} : TER {tesSUCCESS}));
ter(tecPATH_DRY));
env.close();
}

@@ -1214,8 +1210,7 @@ struct Flow_test : public beast::unit_test::suite
{
testLimitQuality();
testRIPD1443();
testRIPD1449(true);
testRIPD1449(false);
testRIPD1449();

using namespace jtx;
auto const sa = supported_amendments();
Loading