diff --git a/src/ripple/app/paths/RippleCalc.cpp b/src/ripple/app/paths/RippleCalc.cpp index ce83f0c92..8ae23cc4b 100644 --- a/src/ripple/app/paths/RippleCalc.cpp +++ b/src/ripple/app/paths/RippleCalc.cpp @@ -328,7 +328,7 @@ TER RippleCalc::rippleCalculate (detail::FlowDebugInfo* flowDebugInfo) boost::container::flat_set unfundedOffersFromBestPaths; int iPass = 0; - auto const dcSwitch = amendmentRIPD1141(view.info().parentCloseTime); + auto const dcSwitch = fix1141(view.info().parentCloseTime); while (resultCode == temUNCERTAIN) { diff --git a/src/ripple/app/paths/cursor/AdvanceNode.cpp b/src/ripple/app/paths/cursor/AdvanceNode.cpp index c37d7dc75..2805b8781 100644 --- a/src/ripple/app/paths/cursor/AdvanceNode.cpp +++ b/src/ripple/app/paths/cursor/AdvanceNode.cpp @@ -27,7 +27,7 @@ namespace path { TER PathCursor::advanceNode (STAmount const& amount, bool reverse, bool callerHasLiquidity) const { - bool const multi = amendmentRIPD1141 (view ().info ().parentCloseTime) + bool const multi = fix1141 (view ().info ().parentCloseTime) ? (multiQuality_ || (!callerHasLiquidity && amount == zero)) : (multiQuality_ || amount == zero); diff --git a/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp b/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp index efb67a639..e18d2bfad 100644 --- a/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp +++ b/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp @@ -247,7 +247,7 @@ TER PathCursor::deliverNodeReverseImpl ( saInPassAct, saOutAct > zero); - if (amendmentRIPD1141(view().info().parentCloseTime)) + if (fix1141(view().info().parentCloseTime)) { // The recursive call is dry this time, but we have liquidity // from previous calls diff --git a/src/ripple/app/paths/impl/BookStep.cpp b/src/ripple/app/paths/impl/BookStep.cpp index ea7149794..00a75997f 100644 --- a/src/ripple/app/paths/impl/BookStep.cpp +++ b/src/ripple/app/paths/impl/BookStep.cpp @@ -418,7 +418,7 @@ BookStep::revImp ( // subtracting them leaves a result of zero. This can cause the check for // (stpAmt.out > remainingOut) to incorrectly think an offer will be funded // after subtracting remainingIn. - if (amendmentRIPD1298(sb.parentCloseTime())) + if (fix1298(sb.parentCloseTime())) return offer.fully_consumed(); else return false; @@ -575,7 +575,7 @@ BookStep::fwdImp ( // subtracting them leaves a result of zero. This can cause the check for // (stpAmt.in > remainingIn) to incorrectly think an offer will be funded // after subtracting remainingIn. - if (amendmentRIPD1298(sb.parentCloseTime())) + if (fix1298(sb.parentCloseTime())) processMore = processMore || offer.fully_consumed(); return processMore; @@ -692,7 +692,7 @@ BookStep::check(StrandContext const& ctx) const return temBAD_PATH_LOOP; } - if (amendmentRIPD1443(ctx.view.info().parentCloseTime)) + if (fix1443(ctx.view.info().parentCloseTime)) { if (ctx.prevStep) { diff --git a/src/ripple/ledger/View.h b/src/ripple/ledger/View.h index d6717b5a2..555eb1b1e 100644 --- a/src/ripple/ledger/View.h +++ b/src/ripple/ledger/View.h @@ -335,19 +335,19 @@ transferXRP (ApplyView& view, STAmount const& amount, beast::Journal j); -NetClock::time_point const& amendmentRIPD1141SoTime (); -bool amendmentRIPD1141 (NetClock::time_point const closeTime); +NetClock::time_point const& fix1141Time (); +bool fix1141 (NetClock::time_point const closeTime); -NetClock::time_point const& amendmentRIPD1274SoTime (); -bool amendmentRIPD1274 (NetClock::time_point const closeTime); +NetClock::time_point const& fix1274Time (); +bool fix1274 (NetClock::time_point const closeTime); -NetClock::time_point const& amendmentRIPD1298SoTime (); -bool amendmentRIPD1298 (NetClock::time_point const closeTime); +NetClock::time_point const& fix1298Time (); +bool fix1298 (NetClock::time_point const closeTime); -NetClock::time_point const& amendmentRIPD1443SoTime (); -bool amendmentRIPD1443 (NetClock::time_point const closeTime); +NetClock::time_point const& fix1443Time (); +bool fix1443 (NetClock::time_point const closeTime); -NetClock::time_point const& fix1449SoTime (); +NetClock::time_point const& fix1449Time (); bool fix1449 (NetClock::time_point const closeTime); } // ripple diff --git a/src/ripple/ledger/impl/PaymentSandbox.cpp b/src/ripple/ledger/impl/PaymentSandbox.cpp index 776d8f891..2597d7c1f 100644 --- a/src/ripple/ledger/impl/PaymentSandbox.cpp +++ b/src/ripple/ledger/impl/PaymentSandbox.cpp @@ -180,7 +180,7 @@ PaymentSandbox::balanceHook (AccountID const& account, */ auto const currency = amount.getCurrency (); - auto const switchover = amendmentRIPD1141 (info ().parentCloseTime); + auto const switchover = fix1141 (info ().parentCloseTime); auto adjustedAmt = amount; if (switchover) @@ -207,7 +207,7 @@ PaymentSandbox::balanceHook (AccountID const& account, // calculates (but always less than the actual balance). adjustedAmt = std::min(adjustedAmt, minBal); } - if (amendmentRIPD1274 (info ().parentCloseTime)) + if (fix1274 (info ().parentCloseTime)) adjustedAmt.setIssuer(amount.getIssuer()); } else diff --git a/src/ripple/ledger/impl/View.cpp b/src/ripple/ledger/impl/View.cpp index d2bd90caa..7a3c912c1 100644 --- a/src/ripple/ledger/impl/View.cpp +++ b/src/ripple/ledger/impl/View.cpp @@ -31,7 +31,7 @@ namespace ripple { -NetClock::time_point const& amendmentRIPD1141SoTime () +NetClock::time_point const& fix1141Time () { using namespace std::chrono_literals; // Fri July 1, 2016 10:00:00am PDT @@ -39,12 +39,12 @@ NetClock::time_point const& amendmentRIPD1141SoTime () return soTime; } -bool amendmentRIPD1141 (NetClock::time_point const closeTime) +bool fix1141 (NetClock::time_point const closeTime) { - return closeTime > amendmentRIPD1141SoTime(); + return closeTime > fix1141Time(); } -NetClock::time_point const& amendmentRIPD1274SoTime () +NetClock::time_point const& fix1274Time () { using namespace std::chrono_literals; // Fri Sep 30, 2016 10:00:00am PDT @@ -53,12 +53,12 @@ NetClock::time_point const& amendmentRIPD1274SoTime () return soTime; } -bool amendmentRIPD1274 (NetClock::time_point const closeTime) +bool fix1274 (NetClock::time_point const closeTime) { - return closeTime > amendmentRIPD1274SoTime(); + return closeTime > fix1274Time(); } -NetClock::time_point const& amendmentRIPD1298SoTime () +NetClock::time_point const& fix1298Time () { using namespace std::chrono_literals; // Wed Dec 21, 2016 10:00:00am PST @@ -67,12 +67,12 @@ NetClock::time_point const& amendmentRIPD1298SoTime () return soTime; } -bool amendmentRIPD1298 (NetClock::time_point const closeTime) +bool fix1298 (NetClock::time_point const closeTime) { - return closeTime > amendmentRIPD1298SoTime(); + return closeTime > fix1298Time(); } -NetClock::time_point const& amendmentRIPD1443SoTime () +NetClock::time_point const& fix1443Time () { using namespace std::chrono_literals; // Sat Mar 11, 2017 05:00:00pm PST @@ -81,12 +81,12 @@ NetClock::time_point const& amendmentRIPD1443SoTime () return soTime; } -bool amendmentRIPD1443 (NetClock::time_point const closeTime) +bool fix1443 (NetClock::time_point const closeTime) { - return closeTime > amendmentRIPD1443SoTime(); + return closeTime > fix1443Time(); } -NetClock::time_point const& fix1449SoTime () +NetClock::time_point const& fix1449Time () { using namespace std::chrono_literals; // Thurs, Mar 30, 2017 01:00:00pm PDT @@ -97,7 +97,7 @@ NetClock::time_point const& fix1449SoTime () bool fix1449 (NetClock::time_point const closeTime) { - return closeTime > fix1449SoTime(); + return closeTime > fix1449Time(); } // VFALCO NOTE A copy of the other one for now @@ -177,7 +177,7 @@ accountHolds (ReadView const& view, if (isXRP(currency)) { // XRP: return balance minus reserve - if (amendmentRIPD1141 (view.info ().parentCloseTime)) + if (fix1141 (view.info ().parentCloseTime)) { auto const sle = view.read( keylet::account(account)); @@ -1456,7 +1456,7 @@ rippleSend (ApplyView& view, // Calculate the amount to transfer accounting // for any transfer fees: - if (!amendmentRIPD1141 (view.info ().parentCloseTime)) + if (!fix1141 (view.info ().parentCloseTime)) { STAmount const saTransitFee = rippleTransferFee ( view, uSenderID, uReceiverID, issuer, saAmount, j); @@ -1508,7 +1508,7 @@ accountSend (ApplyView& view, return rippleSend (view, uSenderID, uReceiverID, saAmount, saActual, j); } - auto const fv2Switch = amendmentRIPD1141 (view.info ().parentCloseTime); + auto const fv2Switch = fix1141 (view.info ().parentCloseTime); if (!fv2Switch) { auto const dummyBalance = saAmount.zeroed(); diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index a4a222573..57a2545c1 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -698,7 +698,7 @@ struct Flow_test : public beast::unit_test::suite Env env (*this, features (fs)); - auto const closeTime = amendmentRIPD1141SoTime() + + auto const closeTime = fix1141Time() + 100 * env.closed ()->info ().closeTimeResolution; env.close (closeTime); @@ -748,7 +748,7 @@ struct Flow_test : public beast::unit_test::suite auto const timeDelta = Env{*this}.closed ()->info ().closeTimeResolution; for(auto const& d: {-timeDelta*100, +timeDelta*100}){ - auto const closeTime = amendmentRIPD1141SoTime () + d; + auto const closeTime = fix1141Time () + d; Env env (*this); env.close (closeTime); @@ -760,7 +760,7 @@ struct Flow_test : public beast::unit_test::suite env (offer (bob, XRP (100), USD (50))); auto expectedResult = - closeTime < amendmentRIPD1141SoTime () ? tecPATH_DRY : tesSUCCESS; + closeTime < fix1141Time () ? tecPATH_DRY : tesSUCCESS; env (pay (alice, carol, USD (100)), path (~USD), sendmax (XRP (100)), txflags (tfNoRippleDirect | tfPartialPayment | tfLimitQuality), ter (expectedResult)); @@ -812,7 +812,7 @@ struct Flow_test : public beast::unit_test::suite Env env (*this, features (fs)); auto const closeTime = - amendmentRIPD1141SoTime () + 100 * env.closed ()->info ().closeTimeResolution; + fix1141Time () + 100 * env.closed ()->info ().closeTimeResolution; env.close (closeTime); env.fund (XRP (1000000), gw1, gw2); @@ -886,7 +886,7 @@ struct Flow_test : public beast::unit_test::suite Env env (*this, features (fs)); auto const closeTime = - amendmentRIPD1141SoTime () + 100 * env.closed ()->info ().closeTimeResolution; + fix1141Time () + 100 * env.closed ()->info ().closeTimeResolution; env.close (closeTime); env.fund (XRP (1000000), gw1, gw2); @@ -954,7 +954,7 @@ struct Flow_test : public beast::unit_test::suite Env env(*this, features(fs)); // Need new behavior from `accountHolds` - auto const closeTime = amendmentRIPD1141SoTime() + + auto const closeTime = fix1141Time() + env.closed()->info().closeTimeResolution; env.close(closeTime); @@ -983,7 +983,7 @@ struct Flow_test : public beast::unit_test::suite { // Test reverse Env env(*this, features(fs)); - auto closeTime = amendmentRIPD1298SoTime(); + auto closeTime = fix1298Time(); if (withFix) closeTime += env.closed()->info().closeTimeResolution; else @@ -1015,7 +1015,7 @@ struct Flow_test : public beast::unit_test::suite { // Test forward Env env(*this, features(fs)); - auto closeTime = amendmentRIPD1298SoTime(); + auto closeTime = fix1298Time(); if (withFix) closeTime += env.closed()->info().closeTimeResolution; else @@ -1064,7 +1064,7 @@ struct Flow_test : public beast::unit_test::suite env.fund(XRP(10000), alice, bob, gw); // Need to be past this time to see the bug - env.close(amendmentRIPD1274SoTime() + + env.close(fix1274Time() + 100 * env.closed()->info().closeTimeResolution); env(trust(alice, USD(100))); env.close(); @@ -1113,7 +1113,7 @@ struct Flow_test : public beast::unit_test::suite Env env(*this, features(featureFlow)); auto const timeDelta = env.closed ()->info ().closeTimeResolution; auto const d = withFix ? timeDelta*100 : -timeDelta*100; - auto closeTime = amendmentRIPD1443SoTime() + d; + auto closeTime = fix1443Time() + d; env.close(closeTime); auto const alice = Account("alice"); diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index d2f5e4b10..5648b8a25 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -647,7 +647,7 @@ struct PayStrand_test : public beast::unit_test::suite ExistingElementPool eep; Env env(*this, features(featureToStrandV2)); - auto const closeTime = amendmentRIPD1298SoTime() + + auto const closeTime = fix1298Time() + 100 * env.closed()->info().closeTimeResolution; env.close(closeTime); eep.setupEnv(env, /*numAcc*/ 9, /*numCur*/ 6, boost::none); diff --git a/src/test/ledger/PaymentSandbox_test.cpp b/src/test/ledger/PaymentSandbox_test.cpp index 52146a73d..0dda1642b 100644 --- a/src/test/ledger/PaymentSandbox_test.cpp +++ b/src/test/ledger/PaymentSandbox_test.cpp @@ -281,12 +281,12 @@ class PaymentSandbox_test : public beast::unit_test::suite for (auto timeDelta : {-env.closed ()->info ().closeTimeResolution, env.closed ()->info ().closeTimeResolution}) { - auto const closeTime = amendmentRIPD1141SoTime () + timeDelta; + auto const closeTime = fix1141Time () + timeDelta; env.close (closeTime); ApplyViewImpl av (&*env.current (), tapNONE); PaymentSandbox pv (&av); pv.creditHook (gw, alice, hugeAmt, -tinyAmt); - if (closeTime > amendmentRIPD1141SoTime ()) + if (closeTime > fix1141Time ()) BEAST_EXPECT(pv.balanceHook (alice, gw, hugeAmt) == tinyAmt); else BEAST_EXPECT(pv.balanceHook (alice, gw, hugeAmt) != tinyAmt); @@ -317,7 +317,7 @@ class PaymentSandbox_test : public beast::unit_test::suite Account const alice ("alice"); env.fund (reserve(env, 1), alice); - auto const closeTime = amendmentRIPD1141SoTime () + + auto const closeTime = fix1141Time () + 100 * env.closed ()->info ().closeTimeResolution; env.close (closeTime); ApplyViewImpl av (&*env.current (), tapNONE);