20 #include <ripple/app/ledger/LedgerMaster.h>
21 #include <ripple/protocol/jss.h>
23 #include <test/jtx/Env.h>
35 cfg->NETWORK_ID = networkID;
43 testcase(
"tx_id_from_index");
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);
82 env.app().getLedgerMaster().txnIdFromIndex(0, txnIndex);
83 BEAST_EXPECT(!result);
88 env.app().getLedgerMaster().txnIdFromIndex(endLegSeq, 0);
89 BEAST_EXPECT(!result);
94 auto result = env.app().getLedgerMaster().txnIdFromIndex(
95 endLegSeq + 1, txnIndex);
96 BEAST_EXPECT(!result);
101 auto result = env.app().getLedgerMaster().txnIdFromIndex(
102 startLegSeq, txnIndex);
105 uint256(
"277F4FD89C20B92457FEF05FF63F6405563AD0563C73D967A29727"
111 auto result = env.app().getLedgerMaster().txnIdFromIndex(
112 startLegSeq + 1, txnIndex);
115 uint256(
"293DF7335EBBAF4420D52E70ABF470EB4C5792CAEA2F91F76193C2"
124 using namespace test::jtx;