Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TicketBatch a SupportedAmendment so it can be enabled. #3703

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/Feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ detail::supportedAmendments()
"HardenedValidations",
"fixAmendmentMajorityCalc",
//"NegativeUNL", // Commented out to prevent automatic enablement
//"TicketBatch", // Commented out to prevent automatic enablement
"TicketBatch",
};
return supported;
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/app/AccountDelete_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AccountDelete_test : public beast::unit_test::suite

testcase("Basics");

Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account const alice("alice");
Account const becky("becky");
Account const carol("carol");
Expand Down Expand Up @@ -791,7 +791,7 @@ class AccountDelete_test : public beast::unit_test::suite
Account const alice{"alice"};
Account const bob{"bob"};

Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
env.fund(XRP(100000), alice, bob);
env.close();

Expand Down
2 changes: 1 addition & 1 deletion src/test/app/Check_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ class Check_test : public beast::unit_test::suite
Account const bob{"bob"};
IOU const USD{gw["USD"]};

Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
env.fund(XRP(1000), gw, alice, bob);
env.close();

Expand Down
4 changes: 2 additions & 2 deletions src/test/app/DepositAuth_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
{
// Verify that an account can be preauthorized and unauthorized
// using tickets.
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
env.fund(XRP(10000), alice, becky);
env.close();

Expand Down Expand Up @@ -729,7 +729,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
{
testEnable();
testInvalid();
auto const supported{jtx::supported_amendments() | featureTicketBatch};
auto const supported{jtx::supported_amendments()};
testPayment(supported - featureDepositPreauth);
testPayment(supported);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/app/Escrow_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ struct Escrow_test : public beast::unit_test::suite

{
// Create escrow and finish using tickets.
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
env.fund(XRP(5000), alice, bob);
env.close();

Expand Down Expand Up @@ -1569,7 +1569,7 @@ struct Escrow_test : public beast::unit_test::suite

{
// Create escrow and cancel using tickets.
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
env.fund(XRP(5000), alice, bob);
env.close();

Expand Down
7 changes: 3 additions & 4 deletions src/test/app/Flow_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ struct Flow_test : public beast::unit_test::suite
Account const carol("carol");

{
Env env(*this, supported_amendments());
Env env(*this);

env.fund(XRP(10000), alice, bob, carol, gw);

Expand Down Expand Up @@ -1360,7 +1360,6 @@ struct Flow_test : public beast::unit_test::suite
auto const bob = Account("bob");

Env env(*this, features);
BEAST_EXPECT(features[featureTicketBatch]);

env.fund(XRP(10000), alice);

Expand Down Expand Up @@ -1407,7 +1406,7 @@ struct Flow_test : public beast::unit_test::suite
testRIPD1449();

using namespace jtx;
auto const sa = supported_amendments() | featureTicketBatch;
auto const sa = supported_amendments();
testWithFeats(sa - featureFlowCross);
testWithFeats(sa);
testEmptyStrand(sa);
Expand All @@ -1420,7 +1419,7 @@ struct Flow_manual_test : public Flow_test
run() override
{
using namespace jtx;
auto const all = supported_amendments() | featureTicketBatch;
auto const all = supported_amendments();
FeatureBitset const flowCross{featureFlowCross};
FeatureBitset const f1513{fix1513};

Expand Down
5 changes: 1 addition & 4 deletions src/test/app/MultiSign_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,9 +1491,6 @@ class MultiSign_test : public beast::unit_test::suite
env.fund(XRP(2000), alice);
env.close();

// If featureTicketBatch is not enabled expect massive failures.
BEAST_EXPECT(features[featureTicketBatch]);

// Create a few tickets that alice can use up.
std::uint32_t aliceTicketSeq{env.seq(alice) + 1};
env(ticket::create(alice, 20));
Expand Down Expand Up @@ -1550,7 +1547,7 @@ class MultiSign_test : public beast::unit_test::suite
run() override
{
using namespace jtx;
auto const all = supported_amendments() | featureTicketBatch;
auto const all = supported_amendments();

// The reserve required on a signer list changes based on.
// featureMultiSignReserve. Test both with and without.
Expand Down
10 changes: 2 additions & 8 deletions src/test/app/Offer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5157,9 +5157,6 @@ class Offer_test : public beast::unit_test::suite

using namespace jtx;

// Should be called with TicketBatch enabled.
BEAST_EXPECT(features[featureTicketBatch]);

// Two goals for this test.
//
// o Verify that offers can be created using tickets.
Expand Down Expand Up @@ -5280,9 +5277,6 @@ class Offer_test : public beast::unit_test::suite

using namespace jtx;

// Should be called with TicketBatch enabled.
BEAST_EXPECT(features[featureTicketBatch]);

// Verify that offers created with or without tickets can be canceled
// by transactions with or without tickets.
Env env{*this, features};
Expand Down Expand Up @@ -5471,7 +5465,7 @@ class Offer_test : public beast::unit_test::suite
run() override
{
using namespace jtx;
FeatureBitset const all{supported_amendments() | featureTicketBatch};
FeatureBitset const all{supported_amendments()};
FeatureBitset const flowCross{featureFlowCross};
FeatureBitset const takerDryOffer{fixTakerDryOfferRemoval};

Expand All @@ -5489,7 +5483,7 @@ class Offer_manual_test : public Offer_test
run() override
{
using namespace jtx;
FeatureBitset const all{supported_amendments() | featureTicketBatch};
FeatureBitset const all{supported_amendments()};
FeatureBitset const flowCross{featureFlowCross};
FeatureBitset const f1513{fix1513};
FeatureBitset const takerDryOffer{fixTakerDryOfferRemoval};
Expand Down
8 changes: 4 additions & 4 deletions src/test/app/PayChan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ struct PayChan_test : public beast::unit_test::suite
{
// Create a channel where dst disallows XRP. Ignore that flag,
// since it's just advisory.
Env env(*this, supported_amendments());
Env env(*this);
env.fund(XRP(10000), alice, bob);
env(fset(bob, asfDisallowXRP));
auto const chan = channel(alice, bob, env.seq(alice));
Expand All @@ -677,7 +677,7 @@ struct PayChan_test : public beast::unit_test::suite
// Claim to a channel where dst disallows XRP (channel is
// created before disallow xrp is set). Ignore that flag
// since it is just advisory.
Env env(*this, supported_amendments());
Env env(*this);
env.fund(XRP(10000), alice, bob);
auto const chan = channel(alice, bob, env.seq(alice));
env(create(alice, bob, XRP(1000), 3600s, alice.pk()));
Expand Down Expand Up @@ -1588,7 +1588,7 @@ struct PayChan_test : public beast::unit_test::suite

{
// Test with adding the paychan to the recipient's owner directory
Env env(*this, supported_amendments());
Env env(*this);
env.fund(XRP(10000), alice, bob);
env(create(alice, bob, XRP(1000), settleDelay, pk));
env.close();
Expand Down Expand Up @@ -1884,7 +1884,7 @@ struct PayChan_test : public beast::unit_test::suite
testcase("using tickets");
using namespace jtx;
using namespace std::literals::chrono_literals;
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
auto const alice = Account("alice");
auto const bob = Account("bob");
auto USDA = alice["USD"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/app/SetRegularKey_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class SetRegularKey_test : public beast::unit_test::suite
using namespace test::jtx;

testcase("Ticket regular key");
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account const alice{"alice", KeyType::ed25519};
env.fund(XRP(1000), alice);
env.close();
Expand Down
2 changes: 1 addition & 1 deletion src/test/app/SetTrust_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class SetTrust_test : public beast::unit_test::suite
using namespace jtx;

// Verify that TrustSet transactions can use tickets.
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
auto const gw = Account{"gateway"};
auto const alice = Account{"alice"};
auto const USD = gw["USD"];
Expand Down
14 changes: 7 additions & 7 deletions src/test/app/Ticket_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class Ticket_test : public beast::unit_test::suite
testcase("Create Tickets that fail Preflight");

using namespace test::jtx;
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};

Account const master{env.master};

Expand Down Expand Up @@ -474,7 +474,7 @@ class Ticket_test : public beast::unit_test::suite
using namespace test::jtx;
{
// Create tickets on a non-existent account.
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};
env.memoize(alice);

Expand All @@ -485,7 +485,7 @@ class Ticket_test : public beast::unit_test::suite
{
// Exceed the threshold where tickets can no longer be
// added to an account.
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};

env.fund(XRP(100000), alice);
Expand Down Expand Up @@ -524,7 +524,7 @@ class Ticket_test : public beast::unit_test::suite
}
{
// Explore exceeding the ticket threshold from another angle.
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};

env.fund(XRP(100000), alice);
Expand Down Expand Up @@ -564,7 +564,7 @@ class Ticket_test : public beast::unit_test::suite
testcase("Create Ticket Insufficient Reserve");

using namespace test::jtx;
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};

// Fund alice not quite enough to make the reserve for a Ticket.
Expand Down Expand Up @@ -624,7 +624,7 @@ class Ticket_test : public beast::unit_test::suite
testcase("Using Tickets");

using namespace test::jtx;
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};

env.fund(XRP(10000), alice);
Expand Down Expand Up @@ -720,7 +720,7 @@ class Ticket_test : public beast::unit_test::suite
testcase("Transaction Database With Tickets");

using namespace test::jtx;
Env env{*this, supported_amendments() | featureTicketBatch};
Env env{*this};
Account alice{"alice"};

env.fund(XRP(10000), alice);
Expand Down
27 changes: 7 additions & 20 deletions src/test/app/TxQ_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <ripple/basics/Log.h>
#include <ripple/basics/mulDiv.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/Feature.h>
#include <ripple/protocol/jss.h>
#include <ripple/protocol/st.h>
#include <boost/optional.hpp>
Expand Down Expand Up @@ -383,10 +382,7 @@ class TxQ1_test : public beast::unit_test::suite
using namespace jtx;
testcase("queue ticket");

Env env(
*this,
makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}),
supported_amendments() | featureTicketBatch);
Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));

auto alice = Account("alice");

Expand Down Expand Up @@ -1797,10 +1793,7 @@ class TxQ1_test : public beast::unit_test::suite

auto queued = ter(terQUEUED);

Env env(
*this,
makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}),
supported_amendments() | featureTicketBatch);
Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));

BEAST_EXPECT(env.current()->fees().base == 10);

Expand Down Expand Up @@ -2310,7 +2303,7 @@ class TxQ1_test : public beast::unit_test::suite
using namespace std::chrono;
testcase("consequences");

Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
auto const alice = Account("alice");
env.memoize(alice);
env.memoize("bob");
Expand Down Expand Up @@ -2648,8 +2641,7 @@ class TxQ1_test : public beast::unit_test::suite
makeConfig(
{{"minimum_txn_in_ledger_standalone", "1"},
{"ledgers_in_queue", "10"},
{"maximum_txn_per_account", "11"}}),
supported_amendments() | featureTicketBatch);
{"maximum_txn_per_account", "11"}}));

// Alice will have the gaps. Bob will keep the queue busy with
// high fee transactions so alice's transactions can expire to leave
Expand Down Expand Up @@ -4037,10 +4029,7 @@ class TxQ1_test : public beast::unit_test::suite
testcase("Ticket in queue and open ledger");
using namespace jtx;

Env env(
*this,
makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}),
supported_amendments() | featureTicketBatch);
Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));

auto alice = Account("alice");

Expand Down Expand Up @@ -4340,8 +4329,7 @@ class TxQ1_test : public beast::unit_test::suite
{"maximum_txn_per_account", "30"},
{"minimum_queue_size", "50"}});

Env env(
*this, std::move(cfg), supported_amendments() | featureTicketBatch);
Env env(*this, std::move(cfg));

// The noripple is to reduce the number of transactions required to
// fund the accounts. There is no rippling in this test.
Expand Down Expand Up @@ -4546,8 +4534,7 @@ class TxQ1_test : public beast::unit_test::suite
{"maximum_txn_per_account", "30"},
{"minimum_queue_size", "50"}});

Env env(
*this, std::move(cfg), supported_amendments() | featureTicketBatch);
Env env(*this, std::move(cfg));

// The noripple is to reduce the number of transactions required to
// fund the accounts. There is no rippling in this test.
Expand Down
2 changes: 1 addition & 1 deletion src/test/jtx/Env_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class Env_test : public beast::unit_test::suite
ticket::create("alice", 1);

{
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
env.fund(XRP(10000), "alice");
env(noop("alice"),
require(owners("alice", 0), tickets("alice", 0)));
Expand Down
2 changes: 1 addition & 1 deletion src/test/rpc/AccountObjects_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class AccountObjects_test : public beast::unit_test::suite
Account const gw{"gateway"};
auto const USD = gw["USD"];

Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);

// Make a lambda we can use to get "account_objects" easily.
auto acct_objs = [&env](Account const& acct, char const* type) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/rpc/AccountSet_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class AccountSet_test : public beast::unit_test::suite
testTicket()
{
using namespace test::jtx;
Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
Account const alice("alice");

env.fund(XRP(10000), alice);
Expand Down
2 changes: 1 addition & 1 deletion src/test/rpc/AccountTx_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class AccountTx_test : public beast::unit_test::suite
using namespace test::jtx;
using namespace std::chrono_literals;

Env env(*this, supported_amendments() | featureTicketBatch);
Env env(*this);
Account const alice{"alice"};
Account const alie{"alie"};
Account const gw{"gw"};
Expand Down
Loading