mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge remote-tracking branch 'XRPLF/develop' into ximinez/lending-XLS-66
* XRPLF/develop: refactor: Retire fixRmSmallIncreasedQOffers amendment (5955) refactor: Sorts retired amendments to reduce conflicts (5966)
This commit is contained in:
@@ -92,7 +92,6 @@ XRPL_FIX (TrustLinesToSelf, Supported::yes, VoteBehavior::DefaultNo
|
||||
XRPL_FEATURE(NonFungibleTokensV1_1, Supported::yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(ExpandedSignerList, Supported::yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(CheckCashMakesTrustLine, Supported::yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FIX (RmSmallIncreasedQOffers, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FIX (STAmountCanonicalize, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYes)
|
||||
@@ -132,28 +131,29 @@ XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete)
|
||||
// pre-amendment code has been removed and the identifiers are deprecated.
|
||||
// All known amendments and amendments that may appear in a validated
|
||||
// ledger must be registered either here or above with the "active" amendments
|
||||
XRPL_RETIRE(MultiSign)
|
||||
XRPL_RETIRE(TrustSetAuth)
|
||||
XRPL_RETIRE(FeeEscalation)
|
||||
XRPL_RETIRE(PayChan)
|
||||
XRPL_RETIRE(CryptoConditions)
|
||||
XRPL_RETIRE(TickSize)
|
||||
XRPL_RETIRE(fix1368)
|
||||
XRPL_RETIRE(Escrow)
|
||||
XRPL_RETIRE(fix1373)
|
||||
XRPL_RETIRE(EnforceInvariants)
|
||||
XRPL_RETIRE(SortedDirectories)
|
||||
XRPL_RETIRE(fix1201)
|
||||
XRPL_RETIRE(fix1368)
|
||||
XRPL_RETIRE(fix1373)
|
||||
XRPL_RETIRE(fix1512)
|
||||
XRPL_RETIRE(fix1523)
|
||||
XRPL_RETIRE(fix1528)
|
||||
XRPL_RETIRE(FlowCross)
|
||||
XRPL_RETIRE(fix1513)
|
||||
XRPL_RETIRE(fix1515)
|
||||
XRPL_RETIRE(fix1523)
|
||||
XRPL_RETIRE(fix1528)
|
||||
XRPL_RETIRE(fix1543)
|
||||
XRPL_RETIRE(fix1781)
|
||||
XRPL_RETIRE(fix1571)
|
||||
XRPL_RETIRE(fix1578)
|
||||
XRPL_RETIRE(fix1781)
|
||||
XRPL_RETIRE(fixCheckThreading)
|
||||
XRPL_RETIRE(fixRmSmallIncreasedQOffers)
|
||||
XRPL_RETIRE(CryptoConditions)
|
||||
XRPL_RETIRE(Escrow)
|
||||
XRPL_RETIRE(EnforceInvariants)
|
||||
XRPL_RETIRE(FeeEscalation)
|
||||
XRPL_RETIRE(FlowCross)
|
||||
XRPL_RETIRE(MultiSign)
|
||||
XRPL_RETIRE(PayChan)
|
||||
XRPL_RETIRE(SortedDirectories)
|
||||
XRPL_RETIRE(TickSize)
|
||||
XRPL_RETIRE(TrustSetAuth)
|
||||
|
||||
// clang-format on
|
||||
|
||||
@@ -366,37 +366,22 @@ public:
|
||||
env(offer(alice, USD(1), aliceTakerGets));
|
||||
env.close();
|
||||
|
||||
if (features[fixRmSmallIncreasedQOffers])
|
||||
env.require(
|
||||
offers(carol, 0),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
if (crossBothOffers)
|
||||
{
|
||||
env.require(
|
||||
offers(carol, 0),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
if (crossBothOffers)
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 0),
|
||||
balance(alice, USD(1))); // alice's offer is crossed
|
||||
}
|
||||
else
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 1),
|
||||
balance(
|
||||
alice, USD(0))); // alice's offer is not crossed
|
||||
}
|
||||
offers(alice, 0),
|
||||
balance(alice, USD(1))); // alice's offer is crossed
|
||||
}
|
||||
else
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 1),
|
||||
offers(bob, 1),
|
||||
offers(carol, 1),
|
||||
balance(alice, USD(0)),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is not crossed at all
|
||||
balance(alice, USD(0))); // alice's offer is not crossed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,36 +419,19 @@ public:
|
||||
ter(expectedTer));
|
||||
env.close();
|
||||
|
||||
if (features[fixRmSmallIncreasedQOffers])
|
||||
if (expectedTer == tesSUCCESS)
|
||||
{
|
||||
if (expectedTer == tesSUCCESS)
|
||||
{
|
||||
env.require(offers(carol, 0));
|
||||
env.require(balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Offers are not removed when payments fail
|
||||
// If that is addressed, the test should show that carol's
|
||||
// offer is removed but not taken, as in the other branch of
|
||||
// this if statement
|
||||
}
|
||||
env.require(offers(carol, 0));
|
||||
env.require(balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
}
|
||||
else
|
||||
{
|
||||
if (partialPayment)
|
||||
{
|
||||
env.require(offers(carol, 0));
|
||||
env.require(
|
||||
balance(carol, USD(0))); // offer is removed and taken
|
||||
}
|
||||
else
|
||||
{
|
||||
// offer is not removed or taken
|
||||
BEAST_EXPECT(isOffer(env, carol, drops(1), USD(1)));
|
||||
}
|
||||
// TODO: Offers are not removed when payments fail
|
||||
// If that is addressed, the test should show that carol's
|
||||
// offer is removed but not taken, as in the other branch of
|
||||
// this if statement
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -526,37 +494,22 @@ public:
|
||||
env(offer(alice, USD(1), aliceTakerGets));
|
||||
env.close();
|
||||
|
||||
if (features[fixRmSmallIncreasedQOffers])
|
||||
env.require(
|
||||
offers(carol, 0),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
if (crossBothOffers)
|
||||
{
|
||||
env.require(
|
||||
offers(carol, 0),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
if (crossBothOffers)
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 0),
|
||||
balance(alice, USD(1))); // alice's offer is crossed
|
||||
}
|
||||
else
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 1),
|
||||
balance(
|
||||
alice, USD(0))); // alice's offer is not crossed
|
||||
}
|
||||
offers(alice, 0),
|
||||
balance(alice, USD(1))); // alice's offer is crossed
|
||||
}
|
||||
else
|
||||
{
|
||||
env.require(
|
||||
offers(alice, 1),
|
||||
offers(bob, 1),
|
||||
offers(carol, 1),
|
||||
balance(alice, USD(0)),
|
||||
balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is not crossed at all
|
||||
balance(alice, USD(0))); // alice's offer is not crossed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,36 +550,19 @@ public:
|
||||
ter(expectedTer));
|
||||
env.close();
|
||||
|
||||
if (features[fixRmSmallIncreasedQOffers])
|
||||
if (expectedTer == tesSUCCESS)
|
||||
{
|
||||
if (expectedTer == tesSUCCESS)
|
||||
{
|
||||
env.require(offers(carol, 0));
|
||||
env.require(balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Offers are not removed when payments fail
|
||||
// If that is addressed, the test should show that carol's
|
||||
// offer is removed but not taken, as in the other branch of
|
||||
// this if statement
|
||||
}
|
||||
env.require(offers(carol, 0));
|
||||
env.require(balance(
|
||||
carol,
|
||||
initialCarolUSD)); // offer is removed but not taken
|
||||
}
|
||||
else
|
||||
{
|
||||
if (partialPayment)
|
||||
{
|
||||
env.require(offers(carol, 0));
|
||||
env.require(
|
||||
balance(carol, USD(0))); // offer is removed and taken
|
||||
}
|
||||
else
|
||||
{
|
||||
// offer is not removed or taken
|
||||
BEAST_EXPECT(isOffer(env, carol, EUR(1), USD(2)));
|
||||
}
|
||||
// TODO: Offers are not removed when payments fail
|
||||
// If that is addressed, the test should show that carol's
|
||||
// offer is removed but not taken, as in the other branch of
|
||||
// this if statement
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5359,8 +5295,6 @@ public:
|
||||
using namespace jtx;
|
||||
static FeatureBitset const all{testable_amendments()};
|
||||
static FeatureBitset const takerDryOffer{fixTakerDryOfferRemoval};
|
||||
static FeatureBitset const rmSmallIncreasedQOffers{
|
||||
fixRmSmallIncreasedQOffers};
|
||||
static FeatureBitset const immediateOfferKilled{
|
||||
featureImmediateOfferKilled};
|
||||
FeatureBitset const fillOrKill{fixFillOrKill};
|
||||
@@ -5369,8 +5303,7 @@ public:
|
||||
static std::array<FeatureBitset, 6> const feats{
|
||||
all - takerDryOffer - immediateOfferKilled - permDEX,
|
||||
all - immediateOfferKilled - permDEX,
|
||||
all - rmSmallIncreasedQOffers - immediateOfferKilled - fillOrKill -
|
||||
permDEX,
|
||||
all - immediateOfferKilled - fillOrKill - permDEX,
|
||||
all - fillOrKill - permDEX,
|
||||
all - permDEX,
|
||||
all};
|
||||
|
||||
@@ -158,9 +158,6 @@ TOfferStreamBase<TIn, TOut>::shouldRmSmallIncreasedQOffer() const
|
||||
!std::is_same_v<TTakerGets, XRPAmount>,
|
||||
"Cannot have XRP/XRP offers");
|
||||
|
||||
if (!view_.rules().enabled(fixRmSmallIncreasedQOffers))
|
||||
return false;
|
||||
|
||||
// Consider removing the offer if:
|
||||
// o `TakerPays` is XRP (because of XRP drops granularity) or
|
||||
// o `TakerPays` and `TakerGets` are both IOU and `TakerPays`<`TakerGets`
|
||||
|
||||
Reference in New Issue
Block a user