21#include <test/jtx/Env.h>
22#include <xrpld/app/ledger/LedgerMaster.h>
34 cfg->NETWORK_ID = networkID;
44 using namespace test::jtx;
45 using namespace std::literals;
49 auto const alice =
Account(
"alice");
50 env.fund(
XRP(1000), alice);
56 auto const startLegSeq = env.current()->info().seq;
57 for (
int i = 0; i < 2; ++i)
63 env.closed()->txRead(env.tx()->getTransactionID()).second);
67 auto const endLegSeq = env.closed()->info().seq;
74 env.app().getLedgerMaster().txnIdFromIndex(ledgerSeq, txnIndex);
75 BEAST_EXPECT(!result);
79 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
81 env.app().getLedgerMaster().txnIdFromIndex(0, txnIndex);
82 BEAST_EXPECT(!result);
87 env.app().getLedgerMaster().txnIdFromIndex(endLegSeq, 0);
88 BEAST_EXPECT(!result);
92 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
93 auto result = env.app().getLedgerMaster().txnIdFromIndex(
94 endLegSeq + 1, txnIndex);
95 BEAST_EXPECT(!result);
99 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
100 auto result = env.app().getLedgerMaster().txnIdFromIndex(
101 startLegSeq, txnIndex);
104 uint256(
"277F4FD89C20B92457FEF05FF63F6405563AD0563C73D967A29727"
109 uint32_t txnIndex = metas[1]->getFieldU32(sfTransactionIndex);
110 auto result = env.app().getLedgerMaster().txnIdFromIndex(
111 startLegSeq + 1, txnIndex);
114 uint256(
"293DF7335EBBAF4420D52E70ABF470EB4C5792CAEA2F91F76193C2"
123 using namespace test::jtx;
testcase_t testcase
Memberspace for declaring test cases.
void testTxnIdFromIndex(FeatureBitset features)
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
void testWithFeats(FeatureBitset features)
void run() override
Runs the suite.
Immutable cryptographic account descriptor.
A transaction testing environment.
T emplace_back(T... args)
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Json::Value noop(Account const &account)
The null transaction.
XRP_t const XRP
Converts to XRP Issue or STAmount.
FeatureBitset supported_amendments()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.