1#include <test/jtx/Account.h>
2#include <test/jtx/Env.h>
3#include <test/jtx/amount.h>
4#include <test/jtx/envconfig.h>
5#include <test/jtx/noop.h>
7#include <xrpld/app/ledger/LedgerMaster.h>
8#include <xrpld/core/Config.h>
10#include <xrpl/basics/base_uint.h>
11#include <xrpl/beast/unit_test/suite.h>
12#include <xrpl/protocol/Feature.h>
13#include <xrpl/protocol/SField.h>
14#include <xrpl/protocol/STObject.h>
15#include <xrpl/protocol/STTx.h>
30 cfg->networkId = networkID;
32 cfg->fees.referenceFee = 10;
47 auto const alice =
Account(
"alice");
54 auto const startLegSeq = env.
current()->header().seq;
55 for (
int i = 0; i < 2; ++i)
64 auto const endLegSeq = env.
closed()->header().seq;
71 BEAST_EXPECT(!result);
75 uint32_t const txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
77 BEAST_EXPECT(!result);
82 BEAST_EXPECT(!result);
86 uint32_t const txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
88 BEAST_EXPECT(!result);
92 uint32_t const txnIndex = metas[0]->getFieldU32(sfTransactionIndex);
98 "277F4FD89C20B92457FEF05FF63F6405563AD0563C73D967A29727"
103 uint32_t const txnIndex = metas[1]->getFieldU32(sfTransactionIndex);
109 "293DF7335EBBAF4420D52E70ABF470EB4C5792CAEA2F91F76193C2"
TestcaseT testcase
Memberspace for declaring test cases.
std::optional< uint256 > txnIdFromIndex(uint32_t ledgerSeq, uint32_t txnIndex)
virtual LedgerMaster & getLedgerMaster()=0
void testWithFeats(FeatureBitset features)
void testTxnIdFromIndex(FeatureBitset features)
void run() override
Runs the suite.
static std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
A transaction testing environment.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
T emplace_back(T... args)
XrpT const XRP
Converts to XRP Issue or STAmount.
json::Value noop(Account const &account)
The null transaction.
FeatureBitset testableAmendments()
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.