21#include <test/jtx/Env.h>
23#include <xrpld/app/ledger/LedgerMaster.h>
35 cfg->NETWORK_ID = networkID;
45 using namespace test::jtx;
46 using namespace std::literals;
50 auto const alice =
Account(
"alice");
51 env.fund(
XRP(1000), alice);
57 auto const startLegSeq = env.current()->info().seq;
58 for (
int i = 0; i < 2; ++i)
64 env.closed()->txRead(env.tx()->getTransactionID()).second);
68 auto const endLegSeq = env.closed()->info().seq;
75 env.app().getLedgerMaster().txnIdFromIndex(ledgerSeq, txnIndex);
76 BEAST_EXPECT(!result);
80 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
82 env.app().getLedgerMaster().txnIdFromIndex(0, txnIndex);
83 BEAST_EXPECT(!result);
88 env.app().getLedgerMaster().txnIdFromIndex(endLegSeq, 0);
89 BEAST_EXPECT(!result);
93 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
94 auto result = env.app().getLedgerMaster().txnIdFromIndex(
95 endLegSeq + 1, txnIndex);
96 BEAST_EXPECT(!result);
100 uint32_t txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
101 auto result = env.app().getLedgerMaster().txnIdFromIndex(
102 startLegSeq, txnIndex);
105 uint256(
"277F4FD89C20B92457FEF05FF63F6405563AD0563C73D967A29727"
110 uint32_t txnIndex = metas[1]->getFieldU32(sfTransactionIndex);
111 auto result = env.app().getLedgerMaster().txnIdFromIndex(
112 startLegSeq + 1, txnIndex);
115 uint256(
"293DF7335EBBAF4420D52E70ABF470EB4C5792CAEA2F91F76193C2"
124 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.