Always enable fix1443 dated March 12, 2017 01:00:00 UTC

This commit is contained in:
Scott Schurr
2019-12-13 15:50:19 -08:00
committed by Manoj doshi
parent 70c21f90b9
commit 9c580b20a3
4 changed files with 17 additions and 46 deletions

View File

@@ -1015,23 +1015,20 @@ BookStep<TIn, TOut, TDerived>::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;
}
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);