20#include <xrpld/core/JobQueue.h>
34 auto const alice =
Account(
"alice");
37 auto const aliceSequence = env.
seq(alice);
39 auto const tx1 = env.
jt(
noop(alice),
seq(aliceSequence));
45 BEAST_EXPECT(env.
seq(alice) == aliceSequence + 1);
48 BEAST_EXPECT(env.
seq(alice) == aliceSequence + 2);
56 result[
"result"][
"meta"][
"TransactionResult"] ==
"tesSUCCESS");
62 result[
"result"][
"meta"][
"TransactionResult"] ==
"tesSUCCESS");
74 cfg->FORCE_MULTI_THREAD =
false;
78 auto const alice =
Account(
"alice");
81 auto const aliceSequence = env.
seq(alice);
83 auto const tx1 = env.
jt(
noop(alice),
seq(aliceSequence));
88 BEAST_EXPECT(env.
seq(alice) == aliceSequence);
91 BEAST_EXPECT(env.
seq(alice) == aliceSequence + 2);
99 result[
"result"][
"meta"][
"TransactionResult"] ==
"tesSUCCESS");
105 result[
"result"][
"meta"][
"TransactionResult"] ==
"tesSUCCESS");
114 testcase(
"Incorrect order multiple intermediaries");
117 cfg->FORCE_MULTI_THREAD =
true;
121 auto const alice =
Account(
"alice");
124 auto const aliceSequence = env.
seq(alice);
127 for (
auto i = 0; i < 5; ++i)
133 for (
auto i = 1; i < 5; ++i)
136 BEAST_EXPECT(env.
seq(alice) == aliceSequence);
141 BEAST_EXPECT(env.
seq(alice) == aliceSequence + 5);
145 for (
auto i = 0; i < 5; ++i)
148 env.
rpc(
"tx",
to_string(tx[i].stx->getTransactionID()));
150 result[
"result"][
"meta"][
"TransactionResult"] ==
"tesSUCCESS");
163BEAST_DEFINE_TESTSUITE(Transaction_ordering, app,
ripple);
testcase_t testcase
Memberspace for declaring test cases.
virtual JobQueue & getJobQueue()=0
void rendezvous()
Block until no jobs running.
Immutable cryptographic account descriptor.
A transaction testing environment.
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Set the expected result code for a JTx The test will fail if the code doesn't match.
T emplace_back(T... args)
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(base_uint< Bits, Tag > const &a)
void run() override
Runs the suite.
void testIncorrectOrder()
void testIncorrectOrderMultipleIntermediaries()
Set the sequence number on a JTx.