3#include <xrpl/protocol/Feature.h>
4#include <xrpl/tx/apply.h>
21 obj[sfLedgerSequence] =
seq;
22 if (rules.
enabled(featureXRPFees))
26 obj[sfReserveIncrementDrops] =
XRPAmount{0};
31 obj[sfReserveBase] = 0;
32 obj[sfReserveIncrement] = 0;
33 obj[sfReferenceFeeUnits] = 0;
39 obj.setFieldH256(sfAmendment,
uint256(2));
40 obj.setFieldU32(sfLedgerSequence,
seq);
54 obj.setAccountID(sfAccount,
AccountID(2));
55 obj.setAccountID(sfDestination,
AccountID(3));
65 Env env(*
this, features);
72 BEAST_EXPECT(reason ==
"Cannot submit pseudo transactions.");
75 BEAST_EXPECT(!result.applied && result.ter ==
temINVALID);
76 return result.applied;
95 using namespace test::jtx;
105BEAST_DEFINE_TESTSUITE(PseudoTx, app,
xrpl);
A generic endpoint for log messages.
bool modify(modify_type const &f)
Modify the open ledger.
Writable ledger view that accumulates state and tx changes.
Rules controlling protocol behavior.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
virtual OpenLedger & getOpenLedger()=0
A transaction testing environment.
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
T emplace_back(T... args)
FeatureBitset testable_amendments()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ApplyResult apply(ServiceRegistry ®istry, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
bool passesLocalChecks(STObject const &st, std::string &)
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
void run() override
Runs the suite.
void testPrevented(FeatureBitset features)
static std::vector< STTx > getPseudoTxs(Rules const &rules, std::uint32_t seq)
static std::vector< STTx > getRealTxs()
Set the sequence number on a JTx.