xrpld
Loading...
Searching...
No Matches
xrpl::test::jtx Namespace Reference

Namespaces

namespace  amm
namespace  batch
 Helpers for constructing Batch test transactions.
namespace  check
 Check operations.
namespace  credentials
namespace  delegate
namespace  deposit
 Deposit preauthorize operations.
namespace  detail
namespace  did
 DID operations.
namespace  directory
 Directory operations.
namespace  escrow
 Escrow operations.
namespace  ledger_state_fix
 LedgerStateFix operations.
namespace  loan
namespace  loan_broker
namespace  oracle
namespace  paychan
 Paychan operations.
namespace  pdomain
namespace  proposal
 Helpers for constructing TransactionProposal test transactions.
namespace  sponsor
namespace  ticket
 Ticket operations.
namespace  token

Classes

class  Account
 Immutable cryptographic account descriptor. More...
struct  AccountIdField
struct  AccountTxnId
class  AMM
 Convenience class to test AMM functionality. More...
class  AMMTest
class  AMMTestBase
struct  AnyAmount
 Amount specifier with an option for any issuer. More...
struct  AnyT
struct  AutofillT
class  Balance
 A balance matches. More...
struct  BasicProp
struct  BidArg
struct  BlobField
struct  BookSpec
struct  ClawbackArg
struct  ConfidentialSendChainState
 When building multiple confidential sends from the same account inside a single batch transaction, pass this state to the transaction builder for each subsequent send so that its proof references the post previous-send encrypted balance rather than the stale pre-send ledger state. More...
struct  CreateArg
class  DeliverMin
 Sets the DeliverMin on a JTx. More...
struct  DepositArg
class  DestTag
 Set DestinationTag on a JTx. More...
struct  DirectStepInfo
struct  DisabledT
class  Domain
 Set the domain on a JTx. More...
struct  Dtag
 Set the destination tag on a JTx. More...
class  Env
 A transaction testing environment. More...
class  EnvSs
 A transaction testing environment wrapper. More...
struct  EpsilonT
class  Expiration
 Set Expiration on a JTx. More...
class  Fee
 Set the fee on a JTx. More...
class  Flags
 Match set account flags. More...
class  Gate
struct  IncrementT
 Used for Fee() calls that use an owner reserve increment. More...
struct  InvoiceId
class  IOU
 Converts to IOU Issue or STAmount. More...
struct  IssuerArgs
class  Json
 Inject raw JSON. More...
struct  JTx
 Execution context for applying a JSON transaction. More...
struct  JTxField
 Generic helper class for helper classes that set a field on a JTx. More...
struct  JTxField< SField, StoredValue, StoredValue >
struct  JTxFieldWrapper
struct  JTxFieldWrapper< BlobField >
struct  LastLedgerSeq
class  LPToken
class  Memo
 Add a memo to a JTx. More...
class  MemoData
class  MemoFormat
class  MemoType
class  MPT
 Converts to MPT Issue or STAmount. More...
struct  MPTAuthorize
 Arguments for building an MPTokenAuthorize test transaction. More...
class  MptBalance
 Test helper that checks MPT issuance or holder balances. More...
struct  MPTConfidentialClawback
 Arguments for building a ConfidentialMPTClawback test transaction. More...
struct  MPTConfidentialSend
 Arguments for building a ConfidentialMPTSend test transaction. More...
struct  MPTConvert
 Arguments for building a ConfidentialMPTConvert test transaction. More...
struct  MPTConvertBack
 Arguments for building a ConfidentialMPTConvertBack test transaction. More...
struct  MPTCreate
 Arguments for building an MPTokenIssuanceCreate test transaction. More...
struct  MPTDestroy
 Arguments for building an MPTokenIssuanceDestroy test transaction. More...
struct  MPTEndpointStepInfo
class  MptFlags
 Test helper that checks MPT flag settings after creation. More...
struct  MPTHolderKeyUpdate
 Arguments for building a ConfidentialMPTHolderKeyUpdate test transaction. More...
struct  MPTInit
 Arguments for initializing funded MPT test accounts and issuance. More...
struct  MPTInitDef
 Full constructor arguments for MPTTester initialization. More...
struct  MPTMergeInbox
 Arguments for building a ConfidentialMPTMergeInbox test transaction. More...
struct  MPTMirrorUpdate
 Arguments for building a ConfidentialMPTMirrorUpdate test transaction. More...
struct  MPTSet
 Arguments for building an MPTokenIssuanceSet test transaction. More...
class  MPTTester
 Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state. More...
class  Msig
 Set a multisignature on a JTx. More...
class  Nflags
 Match clear account flags. More...
struct  None
struct  NoneT
class  OwnerCount
class  Owners
 Match the number of items in the account's owner directory. More...
struct  ParseError
 Thrown when parse fails. More...
class  Path
 Add a path. More...
class  Paths
 Set Paths, SendMax on a JTx. More...
struct  PedersenProofParams
 Stores the parameters that are exclusively used to generate a Pedersen linkage proof. More...
class  PermissionedDEX
struct  PrettyAmount
 Represents an XRP, IOU, or MPT quantity This customizes the string conversion and supports XRP conversions from integer and floating point. More...
struct  PrettyAsset
struct  Prop
 Set a property on a JTx. More...
struct  PropType
class  QualityIn
 Sets the literal QualityIn on a trust JTx. More...
class  QualityInPercent
 Sets the QualityIn on a trust JTx. More...
class  QualityOut
 Sets the literal QualityOut on a trust JTx. More...
class  QualityOutPercent
 Sets the QualityOut on a trust JTx as a percentage. More...
struct  Reg
class  Require
 Check a set of conditions. More...
class  RequireAny
 Test helper that accepts any condition supplied by a callback. More...
class  Rpc
 Set the expected result code for a JTx The test will fail if the code doesn't match. More...
class  Sendmax
 Sets the SendMax on a JTx. More...
struct  Seq
 Set the sequence number on a JTx. More...
class  Sig
 Set the regular signature on a JTx. More...
struct  Signer
 A signer in a SignerList. More...
class  SourceTag
 Set SourceTag on a JTx. More...
class  SponsoredOwners
 Match the account's SponsoredOwnerCount field: the number of owned objects whose reserve is sponsored by another account. More...
class  SponsoringAccountCount
 Match the account's SponsoringAccountCount field: the number of accounts whose base reserve this account sponsors. More...
class  SponsoringOwners
 Match the account's SponsoringOwnerCount field: the number of objects (owned by other accounts) whose reserve this account sponsors. More...
struct  Stag
 Set the source tag on a JTx. More...
struct  StAmountField
class  SuiteLogs
class  Ter
 Set the expected result code for a JTx The test will fail if the code doesn't match. More...
struct  TestAMMArg
struct  TestAMMArgs
struct  TimePointField
class  Txflags
 Set the flags on a JTx. More...
struct  UInt256Field
struct  ValueUnitField
struct  Vault
struct  VoteArg
struct  WithdrawArg
struct  WithSourceLocation
 Wrapper that captures std::source_location when implicitly constructed. More...
struct  XRPEndpointStepInfo
struct  XrpT

Typedefs

using Checks = OwnerCount<ltCHECK>
 Match the number of checks on the account.
using Holders = std::vector<Account>
using SigLists = OwnerCount<ltSIGNER_LIST>
 The number of signer lists matches.
using Lines = OwnerCount<ltRIPPLE_STATE>
 Match the number of trust lines in the account's owner directory.
using Offers = OwnerCount<ltOFFER>
 Match the number of offers in the account's owner directory.
using MPTokens = OwnerCount<ltMPTOKEN>
 Match the number of MPToken in the account's owner directory.
using RequireT = std::function<void(Env&)>
using RequiresT = std::vector<RequireT>
template<class SField, class UnitTag, class ValueType = typename SField::type::value_type>
using ValueUnitWrapper = JTxFieldWrapper<ValueUnitField<SField, UnitTag, ValueType>>
template<class SField, class StoredValue = typename SField::type::value_type>
using SimpleField = JTxFieldWrapper<JTxField<SField, StoredValue>>
using Tickets = OwnerCount<ltTICKET>
 Match the number of tickets on the account.

Enumerations

enum class  Fund { All , Acct , Gw , TokenOnly }

Functions

bool operator== (Account const &lhs, Account const &rhs) noexcept
template<class Hasher>
void hash_append (Hasher &h, Account const &v) noexcept
auto operator<=> (Account const &lhs, Account const &rhs) noexcept
json::Value acctdelete (Account const &account, Account const &dest)
 Delete account.
void incLgrSeqForAccDel (jtx::Env &env, jtx::Account const &acc, std::uint32_t margin=0)
std::vector< STAmount > fund (jtx::Env &env, jtx::Account const &gw, std::vector< jtx::Account > const &accounts, std::vector< STAmount > const &amts, Fund how)
std::vector< STAmount > fund (jtx::Env &env, jtx::Account const &gw, std::vector< jtx::Account > const &accounts, STAmount const &xrp, std::vector< STAmount > const &amts={}, Fund how=Fund::All)
std::vector< STAmount > fund (jtx::Env &env, std::vector< jtx::Account > const &accounts, STAmount const &xrp, std::vector< STAmount > const &amts={}, Fund how=Fund::All, std::optional< Account > const &mptIssuer=std::nullopt)
bool operator== (PrettyAmount const &lhs, PrettyAmount const &rhs)
std::ostream & operator<< (std::ostream &os, PrettyAmount const &amount)
template<class Integer>
requires (std::is_integral_v<Integer>)
PrettyAmount drops (Integer i)
 Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
PrettyAmount drops (XRPAmount i)
 Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
std::ostream & operator<< (std::ostream &os, IOU const &iou)
std::ostream & operator<< (std::ostream &os, MPT const &mpt)
template<class... Args>
std::array< Account, 1+sizeof...(Args)> noripple (Account const &account, Args const &... args)
 Designate accounts as no-ripple in Env::fund.
FeatureBitset testableAmendments ()
std::vector< FeatureBitset > amendmentCombinations (std::initializer_list< UInt256 > features, FeatureBitset seed)
 Returns all 2^N permutations of a seed FeatureBitset with each subset of the given features excluded.
std::unique_ptr< Config > envconfig ()
 creates and initializes a default configuration for jtx::Env
template<class F, class... Args>
std::unique_ptr< Config > envconfig (F &&modfunc, Args &&... args)
 creates and initializes a default configuration for jtx::Env and invokes the provided function/lambda with the configuration object.
std::unique_ptr< Config > onlineDelete (std::unique_ptr< Config > cfg, std::uint32_t deleteInterval=8)
 adjust config to enable online_delete
std::unique_ptr< Config > noAdmin (std::unique_ptr< Config >)
 adjust config so no admin ports are enabled
std::unique_ptr< Config > secureGateway (std::unique_ptr< Config >)
std::unique_ptr< Config > adminLocalnet (std::unique_ptr< Config >)
std::unique_ptr< Config > secureGatewayLocalnet (std::unique_ptr< Config >)
std::unique_ptr< Config > singleThreadIo (std::unique_ptr< Config >)
std::unique_ptr< Config > validator (std::unique_ptr< Config >, std::string const &)
 adjust configuration with params needed to be a validator
std::unique_ptr< Config > addGrpcConfig (std::unique_ptr< Config >)
 add a grpc address and port to config
std::unique_ptr< Config > addGrpcConfigWithSecureGateway (std::unique_ptr< Config >, std::string const &secureGateway)
 add a grpc address, port and secureGateway to config
std::unique_ptr< Config > addGrpcConfigWithTLS (std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath)
 add a grpc address, port and TLS certificate/key paths to config
std::unique_ptr< Config > addGrpcConfigWithTLSAndClientCA (std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath, std::string const &clientCAPath)
 add a grpc address, port and TLS certificate/key/client CA paths to config
std::unique_ptr< Config > addGrpcConfigWithTLSAndCertChain (std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath, std::string const &certChainPath)
 add a grpc address, port and TLS with server cert chain to config
std::unique_ptr< Config > makeConfig (std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
json::Value fset (Account const &account, std::uint32_t on, std::uint32_t off=0)
 Add and/or remove flag.
json::Value fclear (Account const &account, std::uint32_t off)
 Remove account flag.
static Number number (STAmount const &a)
template<typename T>
static std::string toPlaces (T const d, std::uint8_t places)
void doBalance (Env &env, AccountID const &account, bool kNone, STAmount const &value, Issue const &issue)
void doBalance (Env &env, AccountID const &account, bool kNone, STAmount const &value, MPTIssue const &mptIssue)
static MPTCreate makeMPTCreate (MPTInitDef const &arg)
static Buffer parseSenderEncAmt (json::Value const &jv)
std::optional< ConfidentialSendChainState > computeNextSendChainState (std::uint64_t currentSpending, Slice const &currentEncSpending, std::uint32_t currentVersion, std::uint64_t sendAmt, Slice const &senderEncAmt)
 Use this when building a second (or later) confidential send from the same account in the same batch.
json::Value signers (Account const &account, std::uint32_t quorum, std::vector< Signer > const &v)
json::Value signers (Account const &account, NoneT)
 Remove a signer list.
json::Value offer (Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags=0)
 Create an offer.
json::Value offerCancel (Account const &account, std::uint32_t offerSeq)
 Cancel an offer.
json::Value pay (AccountID const &account, AccountID const &to, AnyAmount amount)
 Create a payment.
json::Value pay (Account const &account, Account const &to, AnyAmount amount)
UInt256 setupDomain (jtx::Env &env, std::vector< jtx::Account > const &accounts, jtx::Account const &domainOwner, std::string const &credType)
static void insertQualityIntoJtx (SField const &field, std::uint32_t value, JTx &jt)
json::Value rate (Account const &account, double multiplier)
 Set a transfer rate.
json::Value regkey (Account const &account, DisabledT)
 Disable the regular key.
json::Value regkey (Account const &account, Account const &signer)
 Set a regular key.
json::Value getAccountOffers (Env &env, AccountID const &acct, bool current)
json::Value getAccountLines (Env &env, AccountID const &acctId)
bool checkArraySize (json::Value const &val, unsigned int size)
std::uint32_t ownerCount (Env const &env, Account const &account)
uint64_t mptEscrowed (jtx::Env const &env, jtx::Account const &account, jtx::MPT const &mpt)
uint64_t issuerMPTEscrowed (jtx::Env const &env, jtx::MPT const &mpt)
jtx::PrettyAmount issuerBalance (jtx::Env &env, jtx::Account const &account, Issue const &issue)
jtx::PrettyAmount issuerEscrowed (jtx::Env &env, jtx::Account const &account, Issue const &issue)
std::uint32_t sponsoredOwnerCount (Env const &env, Account const &account)
std::uint32_t sponsoringOwnerCount (Env const &env, Account const &account)
std::uint32_t sponsoringAccountCount (Env const &env, Account const &account)
void stpathAppendOne (STPath &st, Account const &account)
void stpathAppendOne (STPath &st, STPathElement const &pe)
bool equal (STAmount const &sa1, STAmount const &sa2)
static void addSourceAsset (json::Value &jv, PathAsset const &srcAsset, std::optional< AccountID > const &srcIssuer)
json::Value rpf (jtx::Account const &src, jtx::Account const &dst, STAmount const &dstAmount, std::optional< STAmount > const &sendMax, std::optional< PathAsset > const &srcAsset, std::optional< AccountID > const &srcIssuer)
jtx::Env pathTestEnv (beast::unit_test::Suite &suite)
json::Value findPathsRequest (jtx::Env &env, jtx::Account const &src, jtx::Account const &dst, STAmount const &saDstAmount, std::optional< STAmount > const &saSendMax, std::optional< PathAsset > const &srcAsset, std::optional< AccountID > const &srcIssuer, std::optional< UInt256 > const &domain)
std::tuple< STPathSet, STAmount, STAmount > findPaths (jtx::Env &env, jtx::Account const &src, jtx::Account const &dst, STAmount const &saDstAmount, std::optional< STAmount > const &saSendMax, std::optional< PathAsset > const &srcAsset, std::optional< AccountID > const &srcIssuer, std::optional< UInt256 > const &domain)
std::tuple< STPathSet, STAmount, STAmount > findPathsByElement (jtx::Env &env, jtx::Account const &src, jtx::Account const &dst, STAmount const &saDstAmount, std::optional< STAmount > const &saSendMax, std::optional< STPathElement > const &srcElement, std::optional< AccountID > const &srcIssuer, std::optional< UInt256 > const &domain)
XRPAmount txFee (Env const &env, std::uint16_t n)
PrettyAmount xrpMinusFee (Env const &env, std::int64_t xrpAmount)
bool expectHolding (Env const &env, AccountID const &account, STAmount const &value, bool defaultLimits)
bool expectHolding (Env const &env, AccountID const &account, None const &, Issue const &issue)
bool expectHolding (Env const &env, AccountID const &account, None const &, MPTIssue const &mptIssue)
bool expectHolding (Env const &env, AccountID const &account, None const &value)
bool expectMPT (Env const &env, AccountID const &account, STAmount const &value)
bool expectOffers (Env const &env, AccountID const &account, std::uint16_t size, std::vector< Amounts > const &toMatch)
std::vector< SLE::const_pointer > ownerDirEntries (ReadView const &view, AccountID const &account)
 Return the ledger entries in an account's owner directory.
json::Value ledgerEntryRoot (Env &env, Account const &acct)
json::Value ledgerEntryState (Env &env, Account const &acctA, Account const &acctB, std::string const &currency)
json::Value ledgerEntryOffer (jtx::Env &env, jtx::Account const &acct, std::uint32_t offerSeq)
json::Value ledgerEntryMPT (jtx::Env &env, jtx::Account const &acct, MPTID const &mptID)
json::Value getBookOffers (jtx::Env &env, Asset const &takerPays, Asset const &takerGets)
json::Value accountBalance (Env &env, Account const &acct)
bool expectLedgerEntryRoot (Env &env, Account const &acct, STAmount const &expectedValue)
void nOffers (Env &env, std::size_t n, Account const &account, STAmount const &in, STAmount const &out)
STPathElement cpe (PathAsset const &pa)
STPathElement allPathElements (AccountID const &a, Asset const &asset)
STPathElement ipe (Asset const &asset)
STPathElement iape (AccountID const &account)
STPathElement ape (AccountID const &a)
bool equal (std::unique_ptr< xrpl::Step > const &s1, DirectStepInfo const &dsi)
bool equal (std::unique_ptr< xrpl::Step > const &s1, MPTEndpointStepInfo const &dsi)
bool equal (std::unique_ptr< xrpl::Step > const &s1, XRPEndpointStepInfo const &xrpStepInfo)
bool equal (std::unique_ptr< xrpl::Step > const &s1, xrpl::Book const &bsi)
json::Value trust (Account const &account, STAmount const &amount, std::uint32_t flags=0)
 Modify a trust line.
json::Value trust (Account const &account, STAmount const &amount, Account const &peer, std::uint32_t flags)
 Change flags on a trust line.
json::Value claw (Account const &account, STAmount const &amount, std::optional< Account > const &mptHolder)
STObject parse (json::Value const &jv)
 Convert JSON to STObject.
SignatureRole signatureRole (SField const *subField)
 The role that signs into an optional signature subfield.
void sign (json::Value const &jv, Account const &account, json::Value &sigObject, HashPrefix prefix=HashPrefix::TxSign)
 Sign automatically into a specific Json field of the jv object.
void sign (json::Value &jv, Account const &account)
 Sign automatically.
void fillFee (json::Value &jv, ReadView const &view)
 Set the fee automatically.
void fillSeq (json::Value &jv, ReadView const &view)
 Set the sequence number automatically.
json::Value cmdToJSONRPC (std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
 Given an xrpld unit test rpc command, return the corresponding JSON.
Buffer gMakeZeroBuffer (std::size_t size)
 Create a zero-initialized buffer for malformed cryptography test inputs.
json::Value noop (Account const &account)
 The null transaction.
template<class... Args>
RequireT required (Args const &... args)
 Compose many condition functors into one.
void sortSigners (std::vector< Reg > &signers)
json::Value getAccountOffers (Env &env, Account const &acct, bool current=false)
json::Value getAccountLines (Env &env, Account const &acct)
template<typename... IOU>
json::Value getAccountLines (Env &env, AccountID const &acctId, IOU... ious)
bool hasEnvelope2 (json::Value const &reply)
 Reports whether reply carries the version 2 envelope: jsonrpc equal to rpc::kJsonRpcVersion and ripplerpc equal to rpc::kRippleRpcVersion2, both present.
void setEnvelope2 (json::Value &request)
 Sets the version 2 envelope on request: jsonrpc to rpc::kJsonRpcVersion and ripplerpc to rpc::kRippleRpcVersion2.
bool checkVL (Slice const &result, std::string const &expected)
bool checkVL (SLE::ConstRef sle, SField const &field, std::string const &expected)
template<class T>
requires (std::is_constructible_v<Account, T>)
void stpathAppendOne (STPath &st, T const &t)
template<class T, class... Args>
void stpathAppend (STPath &st, T const &t, Args const &... args)
template<class... Args>
void stpathsetAppend (STPathSet &st, STPath const &p, Args const &... args)
template<class... Args>
STPath stpath (Args const &... args)
template<class... Args>
bool same (STPathSet const &st1, Args const &... args)
template<typename... Amts>
bool expectHolding (Env const &env, AccountID const &account, STAmount const &value, Amts const &... amts)
template<class Iter>
bool strandEqualHelper (Iter i)
template<class Iter, class StepInfo, class... Args>
bool strandEqualHelper (Iter i, StepInfo &&si, Args &&... args)
template<class... Args>
bool equal (Strand const &strand, Args &&... args)
UInt256 getCheckIndex (AccountID const &account, std::uint32_t const sequence)
template<class Suite>
void checkMetrics (Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=kBaseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=kMinEscalationFeeLevel.fee(), std::source_location const location=std::source_location::current())
template<typename TTester>
void testHelper2TokensMix (TTester &&tester)
template<typename TTester>
void testHelper3TokensMix (TTester &&tester)

Variables

static auto gAmmmpt = MPT("AMM")
constexpr XRPAmount kJtxDropsPerXrp {1'000'000}
XrpT const XRP {}
 Converts to XRP Issue or STAmount.
static EpsilonT const kEpsilon
AnyT const kAny {}
 Returns an amount representing "any issuer".
constexpr auto kDefaultSeed = "shUwVw52ofnCUX5m7kPTKzJdr4HEH"
auto const kMptDexFlags = tfMPTCanTrade | tfMPTCanTransfer
static MPTInit const kMptInitNoFund {.fund = false}
static NoneT const kNone
static AutofillT const kAutofill
static DisabledT const kDisabled
static IncrementT const kIncrement
auto const kData = JTxFieldWrapper<BlobField>(sfData)
 General field definitions, or fields used in multiple transaction namespaces.
auto const kAmount = JTxFieldWrapper<StAmountField>(sfAmount)
constexpr FeeLevel64 kBaseFeeLevel {TxQ::kBaseLevel}
constexpr FeeLevel64 kMinEscalationFeeLevel = kBaseFeeLevel * 500

Typedef Documentation

◆ Checks

Match the number of checks on the account.

Definition at line 54 of file check.h.

◆ Holders

Definition at line 157 of file mpt.h.

◆ SigLists

using xrpl::test::jtx::SigLists = OwnerCount<ltSIGNER_LIST>

The number of signer lists matches.

Definition at line 121 of file multisign.h.

◆ Lines

using xrpl::test::jtx::Lines = OwnerCount<ltRIPPLE_STATE>

Match the number of trust lines in the account's owner directory.

Definition at line 132 of file owners.h.

◆ Offers

Match the number of offers in the account's owner directory.

Definition at line 137 of file owners.h.

◆ MPTokens

Match the number of MPToken in the account's owner directory.

Definition at line 142 of file owners.h.

◆ RequireT

Definition at line 10 of file requires.h.

◆ RequiresT

Definition at line 11 of file requires.h.

◆ ValueUnitWrapper

template<class SField, class UnitTag, class ValueType = typename SField::type::value_type>
using xrpl::test::jtx::ValueUnitWrapper = JTxFieldWrapper<ValueUnitField<SField, UnitTag, ValueType>>

Definition at line 309 of file jtx/TestHelpers.h.

◆ SimpleField

template<class SField, class StoredValue = typename SField::type::value_type>
using xrpl::test::jtx::SimpleField = JTxFieldWrapper<JTxField<SField, StoredValue>>

Definition at line 313 of file jtx/TestHelpers.h.

◆ Tickets

Match the number of tickets on the account.

Definition at line 54 of file ticket.h.

Enumeration Type Documentation

◆ Fund

enum class xrpl::test::jtx::Fund
strong
Enumerator
All 
Acct 
Gw 
TokenOnly 

Definition at line 26 of file AMMTest.h.

Function Documentation

◆ operator==() [1/2]

bool xrpl::test::jtx::operator== ( Account const & lhs,
Account const & rhs )
noexcept

Definition at line 150 of file jtx/Account.h.

◆ hash_append()

template<class Hasher>
void xrpl::test::jtx::hash_append ( Hasher & h,
Account const & v )
noexcept

Definition at line 157 of file jtx/Account.h.

◆ operator<=>()

auto xrpl::test::jtx::operator<=> ( Account const & lhs,
Account const & rhs )
noexcept

Definition at line 162 of file jtx/Account.h.

◆ acctdelete()

json::Value xrpl::test::jtx::acctdelete ( jtx::Account const & account,
jtx::Account const & dest )

Delete account.

If successful transfer remaining XRP to dest.

Definition at line 17 of file acctdelete.cpp.

◆ incLgrSeqForAccDel()

void xrpl::test::jtx::incLgrSeqForAccDel ( jtx::Env & env,
jtx::Account const & acc,
std::uint32_t margin = 0 )

Definition at line 30 of file acctdelete.cpp.

◆ fund() [1/3]

std::vector< STAmount > xrpl::test::jtx::fund ( jtx::Env & env,
jtx::Account const & gw,
std::vector< jtx::Account > const & accounts,
std::vector< STAmount > const & amts,
Fund how )

Definition at line 34 of file AMMTest.cpp.

◆ fund() [2/3]

std::vector< STAmount > xrpl::test::jtx::fund ( jtx::Env & env,
jtx::Account const & gw,
std::vector< jtx::Account > const & accounts,
STAmount const & xrp,
std::vector< STAmount > const & amts = {},
Fund how = Fund::All )

Definition at line 92 of file AMMTest.cpp.

◆ fund() [3/3]

std::vector< STAmount > xrpl::test::jtx::fund ( jtx::Env & env,
std::vector< jtx::Account > const & accounts,
STAmount const & xrp,
std::vector< STAmount > const & amts = {},
Fund how = Fund::All,
std::optional< Account > const & mptIssuer = std::nullopt )

Definition at line 45 of file AMMTest.cpp.

◆ operator==() [2/2]

bool xrpl::test::jtx::operator== ( PrettyAmount const & lhs,
PrettyAmount const & rhs )

Definition at line 160 of file src/test/jtx/amount.h.

◆ operator<<() [1/3]

std::ostream & xrpl::test::jtx::operator<< ( std::ostream & os,
PrettyAmount const & amount )

Definition at line 45 of file amount.cpp.

◆ drops() [1/2]

template<class Integer>
requires (std::is_integral_v<Integer>)
PrettyAmount xrpl::test::jtx::drops ( Integer i)

Returns an XRP PrettyAmount, which is trivially convertible to STAmount.

Example: drops(10) Returns PrettyAmount of 10 drops

Definition at line 361 of file src/test/jtx/amount.h.

◆ drops() [2/2]

PrettyAmount xrpl::test::jtx::drops ( XRPAmount i)

Returns an XRP PrettyAmount, which is trivially convertible to STAmount.

Example: drops(view->fee().basefee) Returns PrettyAmount of 10 drops

Definition at line 374 of file src/test/jtx/amount.h.

◆ operator<<() [2/3]

std::ostream & xrpl::test::jtx::operator<< ( std::ostream & os,
IOU const & iou )

Definition at line 106 of file amount.cpp.

◆ operator<<() [3/3]

std::ostream & xrpl::test::jtx::operator<< ( std::ostream & os,
MPT const & mpt )

Definition at line 113 of file amount.cpp.

◆ noripple()

template<class... Args>
std::array< Account, 1+sizeof...(Args)> xrpl::test::jtx::noripple ( Account const & account,
Args const &... args )

Designate accounts as no-ripple in Env::fund.

Definition at line 86 of file Env.h.

◆ testableAmendments()

FeatureBitset xrpl::test::jtx::testableAmendments ( )

Definition at line 92 of file Env.h.

◆ amendmentCombinations()

std::vector< FeatureBitset > xrpl::test::jtx::amendmentCombinations ( std::initializer_list< UInt256 > features,
FeatureBitset seed )

Returns all 2^N permutations of a seed FeatureBitset with each subset of the given features excluded.

The seed is included as the first element.

Useful for running a test over every combination of optional amendments so that each case is exercised both with and without each feature.

Definition at line 123 of file Env.h.

◆ envconfig() [1/2]

std::unique_ptr< Config > xrpl::test::jtx::envconfig ( )

creates and initializes a default configuration for jtx::Env

Returns
unique_ptr to Config instance

Definition at line 38 of file envconfig.h.

◆ envconfig() [2/2]

template<class F, class... Args>
std::unique_ptr< Config > xrpl::test::jtx::envconfig ( F && modfunc,
Args &&... args )

creates and initializes a default configuration for jtx::Env and invokes the provided function/lambda with the configuration object.

Parameters
modfunccallable function or lambda to modify the default config. The first argument to the function must be std::unique_ptr to xrpl::Config. The function takes ownership of the unique_ptr and relinquishes ownership by returning a unique_ptr.
argsadditional arguments that will be passed to the config modifier function (optional)
Returns
unique_ptr to Config instance

Definition at line 61 of file envconfig.h.

◆ onlineDelete()

std::unique_ptr< Config > xrpl::test::jtx::onlineDelete ( std::unique_ptr< Config > cfg,
std::uint32_t deleteInterval = 8 )

adjust config to enable online_delete

Parameters
cfgconfig instance to be modified
deleteIntervalhow many new ledgers should be available before rotating. Defaults to 8, because the standalone minimum is 8.
Returns
unique_ptr to Config instance

Definition at line 67 of file envconfig.cpp.

◆ noAdmin()

std::unique_ptr< Config > xrpl::test::jtx::noAdmin ( std::unique_ptr< Config > cfg)

adjust config so no admin ports are enabled

this is intended for use with envconfig, as in envconfig(noAdmin)

Parameters
cfgconfig instance to be modified
Returns
unique_ptr to Config instance

Definition at line 76 of file envconfig.cpp.

◆ secureGateway()

std::unique_ptr< Config > xrpl::test::jtx::secureGateway ( std::unique_ptr< Config > cfg)

Definition at line 84 of file envconfig.cpp.

◆ adminLocalnet()

std::unique_ptr< Config > xrpl::test::jtx::adminLocalnet ( std::unique_ptr< Config > cfg)

Definition at line 93 of file envconfig.cpp.

◆ secureGatewayLocalnet()

std::unique_ptr< Config > xrpl::test::jtx::secureGatewayLocalnet ( std::unique_ptr< Config > cfg)

Definition at line 101 of file envconfig.cpp.

◆ singleThreadIo()

std::unique_ptr< Config > xrpl::test::jtx::singleThreadIo ( std::unique_ptr< Config > cfg)

Definition at line 110 of file envconfig.cpp.

◆ validator()

std::unique_ptr< Config > xrpl::test::jtx::validator ( std::unique_ptr< Config > cfg,
std::string const & seed )

adjust configuration with params needed to be a validator

this is intended for use with envconfig, as in envconfig(validator, myseed)

Parameters
cfgconfig instance to be modified
seedseed string for use in secret key generation. A fixed default value will be used if this string is empty
Returns
unique_ptr to Config instance

Definition at line 119 of file envconfig.cpp.

◆ addGrpcConfig()

std::unique_ptr< Config > xrpl::test::jtx::addGrpcConfig ( std::unique_ptr< Config > cfg)

add a grpc address and port to config

This is intended for use with envconfig, for tests that require a grpc server. If this function is not called, grpc server will not start

Parameters
cfgconfig instance to be modified

Definition at line 128 of file envconfig.cpp.

◆ addGrpcConfigWithSecureGateway()

std::unique_ptr< Config > xrpl::test::jtx::addGrpcConfigWithSecureGateway ( std::unique_ptr< Config > cfg,
std::string const & secureGateway )

add a grpc address, port and secureGateway to config

This is intended for use with envconfig, for tests that require a grpc server. If this function is not called, grpc server will not start

Parameters
cfgconfig instance to be modified

Definition at line 136 of file envconfig.cpp.

◆ addGrpcConfigWithTLS()

std::unique_ptr< Config > xrpl::test::jtx::addGrpcConfigWithTLS ( std::unique_ptr< Config > cfg,
std::string const & certPath,
std::string const & keyPath )

add a grpc address, port and TLS certificate/key paths to config

This is intended for use with envconfig, for tests that require a grpc server with TLS enabled.

Parameters
cfgconfig instance to be modified
certPathpath to SSL certificate file
keyPathpath to SSL private key file

Definition at line 148 of file envconfig.cpp.

◆ addGrpcConfigWithTLSAndClientCA()

std::unique_ptr< Config > xrpl::test::jtx::addGrpcConfigWithTLSAndClientCA ( std::unique_ptr< Config > cfg,
std::string const & certPath,
std::string const & keyPath,
std::string const & clientCAPath )

add a grpc address, port and TLS certificate/key/client CA paths to config

This is intended for use with envconfig, for tests that require a grpc server with mutual TLS (client certificate verification) enabled.

Parameters
cfgconfig instance to be modified
certPathpath to SSL certificate file
keyPathpath to SSL private key file
clientCAPathpath to SSL client CA certificate file for mTLS

Definition at line 161 of file envconfig.cpp.

◆ addGrpcConfigWithTLSAndCertChain()

std::unique_ptr< Config > xrpl::test::jtx::addGrpcConfigWithTLSAndCertChain ( std::unique_ptr< Config > cfg,
std::string const & certPath,
std::string const & keyPath,
std::string const & certChainPath )

add a grpc address, port and TLS with server cert chain to config

This is intended for use with envconfig, for tests that require a grpc server with TLS enabled and intermediate CA certificates.

Parameters
cfgconfig instance to be modified
certPathpath to SSL certificate file
keyPathpath to SSL private key file
certChainPathpath to SSL intermediate CA certificate(s) file

Definition at line 176 of file envconfig.cpp.

◆ makeConfig()

std::unique_ptr< Config > xrpl::test::jtx::makeConfig ( std::map< std::string, std::string > extraTxQ = {},
std::map< std::string, std::string > extraVoting = {} )

Definition at line 191 of file envconfig.cpp.

◆ fset()

json::Value xrpl::test::jtx::fset ( Account const & account,
std::uint32_t on,
std::uint32_t off = 0 )

Add and/or remove flag.

Definition at line 15 of file flags.cpp.

◆ fclear()

json::Value xrpl::test::jtx::fclear ( Account const & account,
std::uint32_t off )

Remove account flag.

Definition at line 110 of file flags.h.

◆ number()

Number xrpl::test::jtx::number ( STAmount const & a)
static

Definition at line 44 of file AMM.cpp.

◆ toPlaces()

template<typename T>
std::string xrpl::test::jtx::toPlaces ( T const d,
std::uint8_t places )
static

Definition at line 30 of file amount.cpp.

◆ doBalance() [1/2]

void xrpl::test::jtx::doBalance ( Env & env,
AccountID const & account,
bool kNone,
STAmount const & value,
Issue const & issue )

Definition at line 21 of file balance.cpp.

◆ doBalance() [2/2]

void xrpl::test::jtx::doBalance ( Env & env,
AccountID const & account,
bool kNone,
STAmount const & value,
MPTIssue const & mptIssue )

Definition at line 56 of file balance.cpp.

◆ makeMPTCreate()

MPTCreate xrpl::test::jtx::makeMPTCreate ( MPTInitDef const & arg)
static

Definition at line 275 of file mpt.cpp.

◆ parseSenderEncAmt()

Buffer xrpl::test::jtx::parseSenderEncAmt ( json::Value const & jv)
static

Definition at line 1781 of file mpt.cpp.

◆ computeNextSendChainState()

std::optional< ConfidentialSendChainState > xrpl::test::jtx::computeNextSendChainState ( std::uint64_t currentSpending,
Slice const & currentEncSpending,
std::uint32_t currentVersion,
std::uint64_t sendAmt,
Slice const & senderEncAmt )

Use this when building a second (or later) confidential send from the same account in the same batch.

Pass the state to the chain aware transaction builder so that the next proof is constructed against the correct post-send encrypted balance and version.

Parameters
currentSpendingDecrypted spending balance before the send.
currentEncSpendingsfConfidentialBalanceSpending before the send.
currentVersionsfConfidentialBalanceVersion before the send.
sendAmtPlaintext amount being sent.
senderEncAmtsfSenderEncryptedAmount from the send transaction.
Returns
The predicted chain state, or std::nullopt if homomorphic subtraction fails.

Definition at line 1809 of file mpt.cpp.

◆ signers() [1/2]

json::Value xrpl::test::jtx::signers ( Account const & account,
std::uint32_t quorum,
std::vector< Signer > const & v )

Definition at line 31 of file multisign.cpp.

◆ signers() [2/2]

json::Value xrpl::test::jtx::signers ( Account const & account,
NoneT  )

Remove a signer list.

Definition at line 51 of file multisign.cpp.

◆ offer()

json::Value xrpl::test::jtx::offer ( Account const & account,
STAmount const & takerPays,
STAmount const & takerGets,
std::uint32_t flags )

Create an offer.

Definition at line 14 of file offer.cpp.

◆ offerCancel()

json::Value xrpl::test::jtx::offerCancel ( Account const & account,
std::uint32_t offerSeq )

Cancel an offer.

Definition at line 31 of file offer.cpp.

◆ pay() [1/2]

json::Value xrpl::test::jtx::pay ( AccountID const & account,
AccountID const & to,
AnyAmount amount )

Create a payment.

Definition at line 14 of file pay.cpp.

◆ pay() [2/2]

json::Value xrpl::test::jtx::pay ( Account const & account,
Account const & to,
AnyAmount amount )

Definition at line 26 of file pay.cpp.

◆ setupDomain()

UInt256 xrpl::test::jtx::setupDomain ( jtx::Env & env,
std::vector< jtx::Account > const & accounts,
jtx::Account const & domainOwner,
std::string const & credType )

Definition at line 19 of file permissioned_dex.cpp.

◆ insertQualityIntoJtx()

void xrpl::test::jtx::insertQualityIntoJtx ( SField const & field,
std::uint32_t value,
JTx & jt )
static

Definition at line 26 of file quality2.cpp.

◆ rate()

json::Value xrpl::test::jtx::rate ( Account const & account,
double multiplier )

Set a transfer rate.

Definition at line 15 of file rate.cpp.

◆ regkey() [1/2]

json::Value xrpl::test::jtx::regkey ( Account const & account,
DisabledT  )

Disable the regular key.

Definition at line 13 of file regkey.cpp.

◆ regkey() [2/2]

json::Value xrpl::test::jtx::regkey ( Account const & account,
Account const & signer )

Set a regular key.

Definition at line 22 of file regkey.cpp.

◆ getAccountOffers() [1/2]

json::Value xrpl::test::jtx::getAccountOffers ( Env & env,
AccountID const & acct,
bool current )

Definition at line 65 of file TestHelpers.cpp.

◆ getAccountLines() [1/3]

json::Value xrpl::test::jtx::getAccountLines ( Env & env,
AccountID const & acctId )

Definition at line 73 of file TestHelpers.cpp.

◆ checkArraySize()

bool xrpl::test::jtx::checkArraySize ( json::Value const & val,
unsigned int size )
nodiscard

Definition at line 81 of file TestHelpers.cpp.

◆ ownerCount()

std::uint32_t xrpl::test::jtx::ownerCount ( Env const & env,
Account const & account )

Definition at line 87 of file TestHelpers.cpp.

◆ mptEscrowed()

uint64_t xrpl::test::jtx::mptEscrowed ( jtx::Env const & env,
jtx::Account const & account,
jtx::MPT const & mpt )

Definition at line 95 of file TestHelpers.cpp.

◆ issuerMPTEscrowed()

uint64_t xrpl::test::jtx::issuerMPTEscrowed ( jtx::Env const & env,
jtx::MPT const & mpt )

Definition at line 104 of file TestHelpers.cpp.

◆ issuerBalance()

jtx::PrettyAmount xrpl::test::jtx::issuerBalance ( jtx::Env & env,
jtx::Account const & account,
Issue const & issue )

Definition at line 113 of file TestHelpers.cpp.

◆ issuerEscrowed()

jtx::PrettyAmount xrpl::test::jtx::issuerEscrowed ( jtx::Env & env,
jtx::Account const & account,
Issue const & issue )

Definition at line 127 of file TestHelpers.cpp.

◆ sponsoredOwnerCount()

std::uint32_t xrpl::test::jtx::sponsoredOwnerCount ( Env const & env,
Account const & account )

Definition at line 141 of file TestHelpers.cpp.

◆ sponsoringOwnerCount()

std::uint32_t xrpl::test::jtx::sponsoringOwnerCount ( Env const & env,
Account const & account )

Definition at line 147 of file TestHelpers.cpp.

◆ sponsoringAccountCount()

std::uint32_t xrpl::test::jtx::sponsoringAccountCount ( Env const & env,
Account const & account )

Definition at line 153 of file TestHelpers.cpp.

◆ stpathAppendOne() [1/3]

void xrpl::test::jtx::stpathAppendOne ( STPath & st,
Account const & account )

Definition at line 161 of file TestHelpers.cpp.

◆ stpathAppendOne() [2/3]

void xrpl::test::jtx::stpathAppendOne ( STPath & st,
STPathElement const & pe )

Definition at line 167 of file TestHelpers.cpp.

◆ equal() [1/6]

bool xrpl::test::jtx::equal ( STAmount const & sa1,
STAmount const & sa2 )

Definition at line 173 of file TestHelpers.cpp.

◆ addSourceAsset()

void xrpl::test::jtx::addSourceAsset ( json::Value & jv,
PathAsset const & srcAsset,
std::optional< AccountID > const & srcIssuer )
static

Definition at line 179 of file TestHelpers.cpp.

◆ rpf()

json::Value xrpl::test::jtx::rpf ( jtx::Account const & src,
jtx::Account const & dst,
STAmount const & dstAmount,
std::optional< STAmount > const & sendMax,
std::optional< PathAsset > const & srcAsset,
std::optional< AccountID > const & srcIssuer )

Definition at line 203 of file TestHelpers.cpp.

◆ pathTestEnv()

jtx::Env xrpl::test::jtx::pathTestEnv ( beast::unit_test::Suite & suite)

Definition at line 229 of file TestHelpers.cpp.

◆ findPathsRequest()

json::Value xrpl::test::jtx::findPathsRequest ( jtx::Env & env,
jtx::Account const & src,
jtx::Account const & dst,
STAmount const & saDstAmount,
std::optional< STAmount > const & saSendMax,
std::optional< PathAsset > const & srcAsset,
std::optional< AccountID > const & srcIssuer,
std::optional< UInt256 > const & domain )

Definition at line 244 of file TestHelpers.cpp.

◆ findPaths()

std::tuple< STPathSet, STAmount, STAmount > xrpl::test::jtx::findPaths ( jtx::Env & env,
jtx::Account const & src,
jtx::Account const & dst,
STAmount const & saDstAmount,
std::optional< STAmount > const & saSendMax,
std::optional< PathAsset > const & srcAsset,
std::optional< AccountID > const & srcIssuer,
std::optional< UInt256 > const & domain )

Definition at line 313 of file TestHelpers.cpp.

◆ findPathsByElement()

std::tuple< STPathSet, STAmount, STAmount > xrpl::test::jtx::findPathsByElement ( jtx::Env & env,
jtx::Account const & src,
jtx::Account const & dst,
STAmount const & saDstAmount,
std::optional< STAmount > const & saSendMax,
std::optional< STPathElement > const & srcElement,
std::optional< AccountID > const & srcIssuer,
std::optional< UInt256 > const & domain )

Definition at line 362 of file TestHelpers.cpp.

◆ txFee()

XRPAmount xrpl::test::jtx::txFee ( Env const & env,
std::uint16_t n )

Definition at line 391 of file TestHelpers.cpp.

◆ xrpMinusFee()

PrettyAmount xrpl::test::jtx::xrpMinusFee ( Env const & env,
std::int64_t xrpAmount )

Definition at line 397 of file TestHelpers.cpp.

◆ expectHolding() [1/5]

bool xrpl::test::jtx::expectHolding ( Env const & env,
AccountID const & account,
STAmount const & value,
bool defaultLimits )
nodiscard

Definition at line 404 of file TestHelpers.cpp.

◆ expectHolding() [2/5]

bool xrpl::test::jtx::expectHolding ( Env const & env,
AccountID const & account,
None const & ,
Issue const & issue )
nodiscard

Definition at line 434 of file TestHelpers.cpp.

◆ expectHolding() [3/5]

bool xrpl::test::jtx::expectHolding ( Env const & env,
AccountID const & account,
None const & ,
MPTIssue const & mptIssue )
nodiscard

Definition at line 440 of file TestHelpers.cpp.

◆ expectHolding() [4/5]

bool xrpl::test::jtx::expectHolding ( Env const & env,
AccountID const & account,
None const & value )
nodiscard

Definition at line 446 of file TestHelpers.cpp.

◆ expectMPT()

bool xrpl::test::jtx::expectMPT ( Env const & env,
AccountID const & account,
STAmount const & value )
nodiscard

Definition at line 454 of file TestHelpers.cpp.

◆ expectOffers()

bool xrpl::test::jtx::expectOffers ( Env const & env,
AccountID const & account,
std::uint16_t size,
std::vector< Amounts > const & toMatch )
nodiscard

Definition at line 462 of file TestHelpers.cpp.

◆ ownerDirEntries()

std::vector< SLE::const_pointer > xrpl::test::jtx::ownerDirEntries ( ReadView const & view,
AccountID const & account )

Return the ledger entries in an account's owner directory.

Definition at line 488 of file TestHelpers.cpp.

◆ ledgerEntryRoot()

json::Value xrpl::test::jtx::ledgerEntryRoot ( Env & env,
Account const & acct )

Definition at line 496 of file TestHelpers.cpp.

◆ ledgerEntryState()

json::Value xrpl::test::jtx::ledgerEntryState ( Env & env,
Account const & acctA,
Account const & acctB,
std::string const & currency )

Definition at line 505 of file TestHelpers.cpp.

◆ ledgerEntryOffer()

json::Value xrpl::test::jtx::ledgerEntryOffer ( jtx::Env & env,
jtx::Account const & acct,
std::uint32_t offerSeq )

Definition at line 517 of file TestHelpers.cpp.

◆ ledgerEntryMPT()

json::Value xrpl::test::jtx::ledgerEntryMPT ( jtx::Env & env,
jtx::Account const & acct,
MPTID const & mptID )

Definition at line 526 of file TestHelpers.cpp.

◆ getBookOffers()

json::Value xrpl::test::jtx::getBookOffers ( jtx::Env & env,
Asset const & takerPays,
Asset const & takerGets )

Definition at line 535 of file TestHelpers.cpp.

◆ accountBalance()

json::Value xrpl::test::jtx::accountBalance ( Env & env,
Account const & acct )

Definition at line 545 of file TestHelpers.cpp.

◆ expectLedgerEntryRoot()

bool xrpl::test::jtx::expectLedgerEntryRoot ( Env & env,
Account const & acct,
STAmount const & expectedValue )
nodiscard

Definition at line 552 of file TestHelpers.cpp.

◆ nOffers()

void xrpl::test::jtx::nOffers ( Env & env,
std::size_t n,
Account const & account,
STAmount const & in,
STAmount const & out )

Definition at line 561 of file TestHelpers.cpp.

◆ cpe()

STPathElement xrpl::test::jtx::cpe ( PathAsset const & pa)

Definition at line 577 of file TestHelpers.cpp.

◆ allPathElements()

STPathElement xrpl::test::jtx::allPathElements ( AccountID const & a,
Asset const & asset )

Definition at line 590 of file TestHelpers.cpp.

◆ ipe()

STPathElement xrpl::test::jtx::ipe ( Asset const & asset)

Definition at line 596 of file TestHelpers.cpp.

◆ iape()

STPathElement xrpl::test::jtx::iape ( AccountID const & account)

Definition at line 617 of file TestHelpers.cpp.

◆ ape()

STPathElement xrpl::test::jtx::ape ( AccountID const & a)

Definition at line 624 of file TestHelpers.cpp.

◆ equal() [2/6]

bool xrpl::test::jtx::equal ( std::unique_ptr< xrpl::Step > const & s1,
DirectStepInfo const & dsi )

Definition at line 630 of file TestHelpers.cpp.

◆ equal() [3/6]

bool xrpl::test::jtx::equal ( std::unique_ptr< xrpl::Step > const & s1,
MPTEndpointStepInfo const & dsi )

Definition at line 638 of file TestHelpers.cpp.

◆ equal() [4/6]

bool xrpl::test::jtx::equal ( std::unique_ptr< xrpl::Step > const & s1,
XRPEndpointStepInfo const & xrpStepInfo )

Definition at line 646 of file TestHelpers.cpp.

◆ equal() [5/6]

bool xrpl::test::jtx::equal ( std::unique_ptr< xrpl::Step > const & s1,
xrpl::Book const & bsi )

Definition at line 654 of file TestHelpers.cpp.

◆ trust() [1/2]

json::Value xrpl::test::jtx::trust ( Account const & account,
STAmount const & amount,
std::uint32_t flags )

Modify a trust line.

Definition at line 18 of file trust.cpp.

◆ trust() [2/2]

json::Value xrpl::test::jtx::trust ( Account const & account,
STAmount const & amount,
Account const & peer,
std::uint32_t flags )

Change flags on a trust line.

Definition at line 35 of file trust.cpp.

◆ claw()

json::Value xrpl::test::jtx::claw ( Account const & account,
STAmount const & amount,
std::optional< Account > const & mptHolder )

Definition at line 51 of file trust.cpp.

◆ parse()

STObject xrpl::test::jtx::parse ( json::Value const & jv)

Convert JSON to STObject.

This throws on failure, the JSON must be correct.

Note
Testing malformed JSON is beyond the scope of this set of unit test routines.

Definition at line 33 of file utility.cpp.

◆ signatureRole()

SignatureRole xrpl::test::jtx::signatureRole ( SField const * subField)

The role that signs into an optional signature subfield.

Parameters
subFieldThe signature field, or nullptr for the transaction's own signature. Throws if the field does not hold a transaction signature.

Definition at line 42 of file utility.cpp.

◆ sign() [1/2]

void xrpl::test::jtx::sign ( json::Value const & jv,
Account const & account,
json::Value & sigObject,
HashPrefix prefix = HashPrefix::TxSign )

Sign automatically into a specific Json field of the jv object.

Parameters
prefixPrefix to insert before the serialized transaction when hashing. Use signingPrefix to get the prefix that matches the field that holds sigObject.
Note
This only works on accounts with multi-signing off.

Definition at line 52 of file utility.cpp.

◆ sign() [2/2]

void xrpl::test::jtx::sign ( json::Value & jv,
Account const & account )

Sign automatically.

Note
This only works on accounts with multi-signing off.

Definition at line 63 of file utility.cpp.

◆ fillFee()

void xrpl::test::jtx::fillFee ( json::Value & jv,
ReadView const & view )

Set the fee automatically.

Definition at line 69 of file utility.cpp.

◆ fillSeq()

void xrpl::test::jtx::fillSeq ( json::Value & jv,
ReadView const & view )

Set the sequence number automatically.

Definition at line 93 of file utility.cpp.

◆ cmdToJSONRPC()

json::Value xrpl::test::jtx::cmdToJSONRPC ( std::vector< std::string > const & args,
beast::Journal j,
unsigned int apiVersion )

Given an xrpld unit test rpc command, return the corresponding JSON.

Definition at line 107 of file utility.cpp.

◆ gMakeZeroBuffer()

Buffer xrpl::test::jtx::gMakeZeroBuffer ( std::size_t size)
nodiscard

Create a zero-initialized buffer for malformed cryptography test inputs.

xrpl::Buffer(size) allocates uninitialized heap memory. Because CI runs unit tests sequentially in the same process, uninitialized memory can recycle valid secp256k1 keys or Pedersen commitments from earlier tests. Explicitly zeroing the buffer guarantees structural validation fails deterministically.

Parameters
sizeThe number of zero bytes to allocate.
Returns
A buffer containing size zero bytes.

Definition at line 62 of file mpt.h.

◆ noop()

json::Value xrpl::test::jtx::noop ( Account const & account)

The null transaction.

Definition at line 14 of file noop.h.

◆ required()

template<class... Args>
RequireT xrpl::test::jtx::required ( Args const &... args)

Compose many condition functors into one.

Definition at line 31 of file require.h.

◆ sortSigners()

void xrpl::test::jtx::sortSigners ( std::vector< Reg > & signers)

Definition at line 41 of file SignerUtils.h.

◆ getAccountOffers() [2/2]

json::Value xrpl::test::jtx::getAccountOffers ( Env & env,
Account const & acct,
bool current = false )

Definition at line 327 of file jtx/TestHelpers.h.

◆ getAccountLines() [2/3]

json::Value xrpl::test::jtx::getAccountLines ( Env & env,
Account const & acct )

Definition at line 336 of file jtx/TestHelpers.h.

◆ getAccountLines() [3/3]

template<typename... IOU>
json::Value xrpl::test::jtx::getAccountLines ( Env & env,
AccountID const & acctId,
IOU... ious )

Definition at line 343 of file jtx/TestHelpers.h.

◆ hasEnvelope2()

bool xrpl::test::jtx::hasEnvelope2 ( json::Value const & reply)
nodiscard

Reports whether reply carries the version 2 envelope: jsonrpc equal to rpc::kJsonRpcVersion and ripplerpc equal to rpc::kRippleRpcVersion2, both present.

Parameters
replyThe reply to inspect.
Returns
True when both members are present with those values.

Definition at line 380 of file jtx/TestHelpers.h.

◆ setEnvelope2()

void xrpl::test::jtx::setEnvelope2 ( json::Value & request)

Sets the version 2 envelope on request: jsonrpc to rpc::kJsonRpcVersion and ripplerpc to rpc::kRippleRpcVersion2.

Parameters
requestThe request to stamp.

Definition at line 393 of file jtx/TestHelpers.h.

◆ checkVL() [1/2]

bool xrpl::test::jtx::checkVL ( Slice const & result,
std::string const & expected )
nodiscard

Definition at line 431 of file jtx/TestHelpers.h.

◆ checkVL() [2/2]

bool xrpl::test::jtx::checkVL ( SLE::ConstRef sle,
SField const & field,
std::string const & expected )
nodiscard

Definition at line 440 of file jtx/TestHelpers.h.

◆ stpathAppendOne() [3/3]

template<class T>
requires (std::is_constructible_v<Account, T>)
void xrpl::test::jtx::stpathAppendOne ( STPath & st,
T const & t )

Definition at line 452 of file jtx/TestHelpers.h.

◆ stpathAppend()

template<class T, class... Args>
void xrpl::test::jtx::stpathAppend ( STPath & st,
T const & t,
Args const &... args )

Definition at line 463 of file jtx/TestHelpers.h.

◆ stpathsetAppend()

template<class... Args>
void xrpl::test::jtx::stpathsetAppend ( STPathSet & st,
STPath const & p,
Args const &... args )

Definition at line 472 of file jtx/TestHelpers.h.

◆ stpath()

template<class... Args>
STPath xrpl::test::jtx::stpath ( Args const &... args)

Definition at line 484 of file jtx/TestHelpers.h.

◆ same()

template<class... Args>
bool xrpl::test::jtx::same ( STPathSet const & st1,
Args const &... args )

Definition at line 493 of file jtx/TestHelpers.h.

◆ expectHolding() [5/5]

template<typename... Amts>
bool xrpl::test::jtx::expectHolding ( Env const & env,
AccountID const & account,
STAmount const & value,
Amts const &... amts )

Definition at line 594 of file jtx/TestHelpers.h.

◆ strandEqualHelper() [1/2]

template<class Iter>
bool xrpl::test::jtx::strandEqualHelper ( Iter i)

Definition at line 701 of file jtx/TestHelpers.h.

◆ strandEqualHelper() [2/2]

template<class Iter, class StepInfo, class... Args>
bool xrpl::test::jtx::strandEqualHelper ( Iter i,
StepInfo && si,
Args &&... args )

Definition at line 709 of file jtx/TestHelpers.h.

◆ equal() [6/6]

template<class... Args>
bool xrpl::test::jtx::equal ( Strand const & strand,
Args &&... args )

Definition at line 718 of file jtx/TestHelpers.h.

◆ getCheckIndex()

UInt256 xrpl::test::jtx::getCheckIndex ( AccountID const & account,
std::uint32_t const sequence )

Definition at line 761 of file jtx/TestHelpers.h.

◆ checkMetrics()

template<class Suite>
void xrpl::test::jtx::checkMetrics ( Suite & test,
jtx::Env & env,
std::size_t expectedCount,
std::optional< std::size_t > expectedMaxCount,
std::size_t expectedInLedger,
std::size_t expectedPerLedger,
std::uint64_t expectedMinFeeLevel = kBaseFeeLevel.fee(),
std::uint64_t expectedMedFeeLevel = kMinEscalationFeeLevel.fee(),
std::source_location const location = std::source_location::current() )

Definition at line 768 of file jtx/TestHelpers.h.

◆ testHelper2TokensMix()

template<typename TTester>
void xrpl::test::jtx::testHelper2TokensMix ( TTester && tester)

Definition at line 1043 of file jtx/TestHelpers.h.

◆ testHelper3TokensMix()

template<typename TTester>
void xrpl::test::jtx::testHelper3TokensMix ( TTester && tester)

Definition at line 1052 of file jtx/TestHelpers.h.

Variable Documentation

◆ gAmmmpt

auto xrpl::test::jtx::gAmmmpt = MPT("AMM")
static

Definition at line 46 of file AMMTest.h.

◆ kJtxDropsPerXrp

XRPAmount xrpl::test::jtx::kJtxDropsPerXrp {1'000'000}
constexpr

Definition at line 70 of file src/test/jtx/amount.h.

◆ XRP

XrpT const xrpl::test::jtx::XRP {}

Converts to XRP Issue or STAmount.

Examples: XRP Converts to the XRP Issue XRP(10) Returns STAmount of 10 XRP

Definition at line 92 of file amount.cpp.

◆ kEpsilon

EpsilonT const xrpl::test::jtx::kEpsilon
static

Definition at line 393 of file src/test/jtx/amount.h.

◆ kAny

AnyT const xrpl::test::jtx::kAny {}

Returns an amount representing "any issuer".

Note
With respect to what the recipient will accept

Definition at line 120 of file amount.cpp.

◆ kDefaultSeed

auto xrpl::test::jtx::kDefaultSeed = "shUwVw52ofnCUX5m7kPTKzJdr4HEH"
constexpr

Definition at line 116 of file envconfig.cpp.

◆ kMptDexFlags

auto const xrpl::test::jtx::kMptDexFlags = tfMPTCanTrade | tfMPTCanTransfer

Definition at line 47 of file mpt.h.

◆ kMptInitNoFund

MPTInit const xrpl::test::jtx::kMptInitNoFund {.fund = false}
static

Definition at line 201 of file mpt.h.

◆ kNone

NoneT const xrpl::test::jtx::kNone
static

Definition at line 9 of file tags.h.

◆ kAutofill

AutofillT const xrpl::test::jtx::kAutofill
static

Definition at line 15 of file tags.h.

◆ kDisabled

DisabledT const xrpl::test::jtx::kDisabled
static

Definition at line 21 of file tags.h.

◆ kIncrement

IncrementT const xrpl::test::jtx::kIncrement
static

Definition at line 31 of file tags.h.

◆ kData

auto const xrpl::test::jtx::kData = JTxFieldWrapper<BlobField>(sfData)

General field definitions, or fields used in multiple transaction namespaces.

Definition at line 318 of file jtx/TestHelpers.h.

◆ kAmount

auto const xrpl::test::jtx::kAmount = JTxFieldWrapper<StAmountField>(sfAmount)

Definition at line 320 of file jtx/TestHelpers.h.

◆ kBaseFeeLevel

FeeLevel64 xrpl::test::jtx::kBaseFeeLevel {TxQ::kBaseLevel}
constexpr

Definition at line 757 of file jtx/TestHelpers.h.

◆ kMinEscalationFeeLevel

FeeLevel64 xrpl::test::jtx::kMinEscalationFeeLevel = kBaseFeeLevel * 500
constexpr

Definition at line 758 of file jtx/TestHelpers.h.