mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Always enable fix1443 dated March 12, 2017 01:00:00 UTC
This commit is contained in:
committed by
Manoj doshi
parent
70c21f90b9
commit
9c580b20a3
@@ -1015,23 +1015,20 @@ BookStep<TIn, TOut, TDerived>::check(StrandContext const& ctx) const
|
|||||||
return tecNO_ISSUER;
|
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 =
|
auto sle =
|
||||||
view.read(keylet::line(*prev, cur, book_.in.currency));
|
view.read(keylet::line(*prev, cur, book_.in.currency));
|
||||||
if (!sle)
|
if (!sle)
|
||||||
return terNO_LINE;
|
return terNO_LINE;
|
||||||
if ((*sle)[sfFlags] &
|
if ((*sle)[sfFlags] &
|
||||||
((cur > *prev) ? lsfHighNoRipple : lsfLowNoRipple))
|
((cur > *prev) ? lsfHighNoRipple : lsfLowNoRipple))
|
||||||
return terNO_RIPPLE;
|
return terNO_RIPPLE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,9 +328,6 @@ transferXRP (ApplyView& view,
|
|||||||
STAmount const& amount,
|
STAmount const& amount,
|
||||||
beast::Journal j);
|
beast::Journal j);
|
||||||
|
|
||||||
[[nodiscard]] NetClock::time_point const& fix1443Time ();
|
|
||||||
[[nodiscard]] bool fix1443 (NetClock::time_point const closeTime);
|
|
||||||
|
|
||||||
[[nodiscard]] NetClock::time_point const& fix1449Time ();
|
[[nodiscard]] NetClock::time_point const& fix1449Time ();
|
||||||
[[nodiscard]] bool fix1449 (NetClock::time_point const closeTime);
|
[[nodiscard]] bool fix1449 (NetClock::time_point const closeTime);
|
||||||
|
|
||||||
|
|||||||
@@ -33,20 +33,6 @@
|
|||||||
|
|
||||||
namespace ripple {
|
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 ()
|
NetClock::time_point const& fix1449Time ()
|
||||||
{
|
{
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|||||||
@@ -1045,17 +1045,12 @@ struct Flow_test : public beast::unit_test::suite
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testRIPD1443(bool withFix)
|
testRIPD1443()
|
||||||
{
|
{
|
||||||
testcase("ripd1443");
|
testcase("ripd1443");
|
||||||
|
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
Env env(*this);
|
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 alice = Account("alice");
|
||||||
auto const bob = Account("bob");
|
auto const bob = Account("bob");
|
||||||
auto const carol = Account("carol");
|
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),
|
env(pay(alice, alice, XRP(1)), path(gw, bob, ~XRP),
|
||||||
sendmax(gw["USD"](1000)), txflags(tfNoRippleDirect),
|
sendmax(gw["USD"](1000)), txflags(tfNoRippleDirect),
|
||||||
ter(withFix ? TER {tecPATH_DRY} : TER {tesSUCCESS}));
|
ter(tecPATH_DRY));
|
||||||
env.close();
|
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(offer(alice, XRP(1000), bob["USD"](1000)));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
env(pay (carol, carol, gw["USD"](1000)), path(~bob["USD"], gw),
|
env(pay (carol, carol, gw["USD"](1000)), path(~bob["USD"], gw),
|
||||||
sendmax(XRP(100000)), txflags(tfNoRippleDirect),
|
sendmax(XRP(100000)), txflags(tfNoRippleDirect),
|
||||||
ter(withFix ? TER {tecPATH_DRY} : TER {tesSUCCESS}));
|
ter(tecPATH_DRY));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
pass();
|
pass();
|
||||||
@@ -1221,8 +1213,7 @@ struct Flow_test : public beast::unit_test::suite
|
|||||||
void run() override
|
void run() override
|
||||||
{
|
{
|
||||||
testLimitQuality();
|
testLimitQuality();
|
||||||
testRIPD1443(true);
|
testRIPD1443();
|
||||||
testRIPD1443(false);
|
|
||||||
testRIPD1449(true);
|
testRIPD1449(true);
|
||||||
testRIPD1449(false);
|
testRIPD1449(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user