From 9c580b20a30760bfbbabbe8e58000a7fe4c069b0 Mon Sep 17 00:00:00 2001 From: Scott Schurr Date: Fri, 13 Dec 2019 15:50:19 -0800 Subject: [PATCH] Always enable fix1443 dated March 12, 2017 01:00:00 UTC --- src/ripple/app/paths/impl/BookStep.cpp | 25 +++++++++++-------------- src/ripple/ledger/View.h | 3 --- src/ripple/ledger/impl/View.cpp | 14 -------------- src/test/app/Flow_test.cpp | 21 ++++++--------------- 4 files changed, 17 insertions(+), 46 deletions(-) diff --git a/src/ripple/app/paths/impl/BookStep.cpp b/src/ripple/app/paths/impl/BookStep.cpp index 61a33d1478..d6c8827771 100644 --- a/src/ripple/app/paths/impl/BookStep.cpp +++ b/src/ripple/app/paths/impl/BookStep.cpp @@ -1015,23 +1015,20 @@ BookStep::check(StrandContext const& ctx) const return tecNO_ISSUER; } - if (fix1443(ctx.view.info().parentCloseTime)) + if (ctx.prevStep) { - if (ctx.prevStep) + if (auto const prev = ctx.prevStep->directStepSrcAcct()) { - if (auto const prev = ctx.prevStep->directStepSrcAcct()) - { - auto const& view = ctx.view; - auto const& cur = book_.in.account; + auto const& view = ctx.view; + auto const& cur = book_.in.account; - auto sle = - view.read(keylet::line(*prev, cur, book_.in.currency)); - if (!sle) - return terNO_LINE; - if ((*sle)[sfFlags] & - ((cur > *prev) ? lsfHighNoRipple : lsfLowNoRipple)) - return terNO_RIPPLE; - } + auto sle = + view.read(keylet::line(*prev, cur, book_.in.currency)); + if (!sle) + return terNO_LINE; + if ((*sle)[sfFlags] & + ((cur > *prev) ? lsfHighNoRipple : lsfLowNoRipple)) + return terNO_RIPPLE; } } diff --git a/src/ripple/ledger/View.h b/src/ripple/ledger/View.h index 42a1fa646a..8940c15e0e 100644 --- a/src/ripple/ledger/View.h +++ b/src/ripple/ledger/View.h @@ -328,9 +328,6 @@ transferXRP (ApplyView& view, STAmount const& amount, beast::Journal j); -[[nodiscard]] NetClock::time_point const& fix1443Time (); -[[nodiscard]] bool fix1443 (NetClock::time_point const closeTime); - [[nodiscard]] NetClock::time_point const& fix1449Time (); [[nodiscard]] bool fix1449 (NetClock::time_point const closeTime); diff --git a/src/ripple/ledger/impl/View.cpp b/src/ripple/ledger/impl/View.cpp index 111b9a02d4..8e1dddae92 100644 --- a/src/ripple/ledger/impl/View.cpp +++ b/src/ripple/ledger/impl/View.cpp @@ -33,20 +33,6 @@ namespace ripple { -NetClock::time_point const& fix1443Time () -{ - using namespace std::chrono_literals; - // Sun Mar 12, 2017 01:00:00 UTC - static NetClock::time_point const soTime{542595600s}; - - return soTime; -} - -bool fix1443 (NetClock::time_point const closeTime) -{ - return closeTime > fix1443Time(); -} - NetClock::time_point const& fix1449Time () { using namespace std::chrono_literals; diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index 564e1e4ea4..064ef7774b 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -1045,17 +1045,12 @@ struct Flow_test : public beast::unit_test::suite } void - testRIPD1443(bool withFix) + testRIPD1443() { testcase("ripd1443"); using namespace jtx; Env env(*this); - auto const timeDelta = env.closed ()->info ().closeTimeResolution; - auto const d = withFix ? 100*timeDelta : -100*timeDelta; - auto closeTime = fix1443Time() + d; - env.close(closeTime); - auto const alice = Account("alice"); auto const bob = Account("bob"); auto const carol = Account("carol"); @@ -1077,21 +1072,18 @@ struct Flow_test : public beast::unit_test::suite env(pay(alice, alice, XRP(1)), path(gw, bob, ~XRP), sendmax(gw["USD"](1000)), txflags(tfNoRippleDirect), - ter(withFix ? TER {tecPATH_DRY} : TER {tesSUCCESS})); + ter(tecPATH_DRY)); env.close(); - if (withFix) - { - env.trust(bob["USD"](10000), alice); - env(pay(bob, alice, bob["USD"](1000))); - } + env.trust(bob["USD"](10000), alice); + env(pay(bob, alice, bob["USD"](1000))); env(offer(alice, XRP(1000), bob["USD"](1000))); env.close(); env(pay (carol, carol, gw["USD"](1000)), path(~bob["USD"], gw), sendmax(XRP(100000)), txflags(tfNoRippleDirect), - ter(withFix ? TER {tecPATH_DRY} : TER {tesSUCCESS})); + ter(tecPATH_DRY)); env.close(); pass(); @@ -1221,8 +1213,7 @@ struct Flow_test : public beast::unit_test::suite void run() override { testLimitQuality(); - testRIPD1443(true); - testRIPD1443(false); + testRIPD1443(); testRIPD1449(true); testRIPD1449(false);