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

Namespaces

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

Classes

class  Account
 Immutable cryptographic account descriptor. More...
struct  AccountTxnId
class  LPToken
struct  CreateArg
struct  DepositArg
struct  WithdrawArg
struct  VoteArg
struct  BidArg
struct  ClawbackArg
class  AMM
 Convenience class to test AMM functionality. More...
struct  TestAMMArg
struct  TestAMMArgs
class  AMMTestBase
class  AMMTest
struct  None
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  BookSpec
struct  XrpT
struct  EpsilonT
class  IOU
 Converts to IOU Issue or STAmount. More...
class  MPT
 Converts to MPT Issue or STAmount. More...
struct  AnyT
struct  AnyAmount
 Amount specifier with an option for any issuer. More...
class  Balance
 A balance matches. More...
struct  BasicProp
struct  PropType
class  DeliverMin
 Sets the DeliverMin on a JTx. More...
class  Domain
 Set the domain on a JTx. More...
struct  WithSourceLocation
 Wrapper that captures std::source_location when implicitly constructed. More...
class  SuiteLogs
class  Env
 A transaction testing environment. More...
class  EnvSs
 A transaction testing environment wrapper. More...
class  Fee
 Set the fee on a JTx. More...
class  Flags
 Match set account flags. More...
class  Nflags
 Match clear account flags. More...
struct  MPTSetFlagMapping
struct  InvoiceId
struct  JTx
 Execution context for applying a JSON transaction. More...
class  Json
 Inject raw JSON. More...
struct  LastLedgerSeq
class  Memo
 Add a memo to a JTx. More...
class  MemoData
class  MemoFormat
class  MemoType
class  MptFlags
 Test helper that checks MPT flag settings after creation. More...
class  MptBalance
 Test helper that checks MPT issuance or holder balances. More...
class  RequireAny
 Test helper that accepts any condition supplied by a callback. More...
struct  MPTCreate
 Arguments for building an MPTokenIssuanceCreate 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  MPTDestroy
 Arguments for building an MPTokenIssuanceDestroy test transaction. More...
struct  MPTAuthorize
 Arguments for building an MPTokenAuthorize test transaction. More...
struct  MPTSet
 Arguments for building an MPTokenIssuanceSet test transaction. More...
struct  MPTConvert
 Arguments for building a ConfidentialMPTConvert test transaction. More...
struct  MPTMergeInbox
 Arguments for building a ConfidentialMPTMergeInbox test transaction. More...
struct  MPTConfidentialSend
 Arguments for building a ConfidentialMPTSend test transaction. More...
struct  MPTConvertBack
 Arguments for building a ConfidentialMPTConvertBack test transaction. More...
struct  MPTConfidentialClawback
 Arguments for building a ConfidentialMPTClawback test transaction. More...
struct  PedersenProofParams
 Stores the parameters that are exclusively used to generate a Pedersen linkage proof. More...
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...
class  MPTTester
 Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state. More...
struct  Signer
 A signer in a SignerList. More...
class  Msig
 Set a multisignature on a JTx. More...
class  OwnerCount
class  Owners
 Match the number of items in the account's owner directory. More...
class  Paths
 Set Paths, SendMax on a JTx. More...
class  Path
 Add a path. More...
class  PermissionedDEX
struct  Prop
 Set a property on a JTx. More...
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...
class  Require
 Check a set of conditions. 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  Reg
struct  Dtag
 Set the destination tag on a JTx. More...
struct  Stag
 Set the source tag on a JTx. More...
struct  NoneT
struct  AutofillT
struct  DisabledT
struct  IncrementT
 Used for Fee() calls that use an owner reserve increment. More...
class  Ter
 Set the expected result code for a JTx The test will fail if the code doesn't match. More...
struct  JTxField
 Generic helper class for helper classes that set a field on a JTx. More...
struct  JTxField< SField, StoredValue, StoredValue >
struct  TimePointField
struct  UInt256Field
struct  AccountIdField
struct  StAmountField
struct  BlobField
struct  ValueUnitField
struct  JTxFieldWrapper
struct  JTxFieldWrapper< BlobField >
class  Gate
struct  DirectStepInfo
struct  MPTEndpointStepInfo
struct  XRPEndpointStepInfo
class  Expiration
 Set Expiration on a JTx. More...
class  SourceTag
 Set SourceTag on a JTx. More...
class  DestTag
 Set DestinationTag on a JTx. More...
struct  IssuerArgs
class  Txflags
 Set the flags on a JTx. More...
struct  ParseError
 Thrown when parse fails. More...
struct  Vault
struct  XChainBridgeObjects

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 require_t = std::function<void(Env&)>
using requires_t = std::vector<require_t>
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.
using JValueVec = std::vector<json::Value>

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< STAmountfund (jtx::Env &env, jtx::Account const &gw, std::vector< jtx::Account > const &accounts, std::vector< STAmount > const &amts, Fund how)
std::vector< STAmountfund (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< STAmountfund (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)
bool operator!= (PrettyAmount const &lhs, PrettyAmount const &rhs)
std::ostreamoperator<< (std::ostream &os, PrettyAmount const &amount)
template<class Integer, class = std::enable_if_t<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::ostreamoperator<< (std::ostream &os, IOU const &iou)
std::ostreamoperator<< (std::ostream &os, MPT const &mpt)
Buffer signClaimAttestation (PublicKey const &pk, SecretKey const &sk, STXChainBridge const &bridge, AccountID const &sendingAccount, STAmount const &sendingAmount, AccountID const &rewardAccount, bool wasLockingChainSend, std::uint64_t claimID, std::optional< AccountID > const &dst)
Buffer signCreateAccountAttestation (PublicKey const &pk, SecretKey const &sk, STXChainBridge const &bridge, AccountID const &sendingAccount, STAmount const &sendingAmount, STAmount const &rewardAmount, AccountID const &rewardAccount, bool wasLockingChainSend, std::uint64_t createCount, AccountID const &dst)
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< FeatureBitsetamendmentCombinations (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< Configenvconfig ()
 creates and initializes a default configuration for jtx::Env
template<class F, class... Args>
std::unique_ptr< Configenvconfig (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< ConfignoAdmin (std::unique_ptr< Config >)
 adjust config so no admin ports are enabled
std::unique_ptr< ConfigsecureGateway (std::unique_ptr< Config >)
std::unique_ptr< ConfigadminLocalnet (std::unique_ptr< Config >)
std::unique_ptr< ConfigsecureGatewayLocalnet (std::unique_ptr< Config >)
std::unique_ptr< ConfigsingleThreadIo (std::unique_ptr< Config >)
std::unique_ptr< Configvalidator (std::unique_ptr< Config >, std::string const &)
 adjust configuration with params needed to be a validator
std::unique_ptr< ConfigaddGrpcConfig (std::unique_ptr< Config >)
 add a grpc address and port to config
std::unique_ptr< ConfigaddGrpcConfigWithSecureGateway (std::unique_ptr< Config >, std::string const &secureGateway)
 add a grpc address, port and secureGateway to config
std::unique_ptr< ConfigaddGrpcConfigWithTLS (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< ConfigaddGrpcConfigWithTLSAndClientCA (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< ConfigaddGrpcConfigWithTLSAndCertChain (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< ConfigmakeConfig (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< ConfidentialSendChainStatecomputeNextSendChainState (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)
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, STAmountfindPaths (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, STAmountfindPathsByElement (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 &env, AccountID const &account, STAmount const &value, bool defaultLimits)
bool expectHolding (Env &env, AccountID const &account, None const &, Issue const &issue)
bool expectHolding (Env &env, AccountID const &account, None const &, MPTIssue const &mptIssue)
bool expectHolding (Env &env, AccountID const &account, None const &value)
bool expectMPT (Env &env, AccountID const &account, STAmount const &value)
bool expectOffers (Env &env, AccountID const &account, std::uint16_t size, std::vector< Amounts > const &toMatch)
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.
void sign (json::Value &jv, Account const &account, json::Value &sigObject)
 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.
json::Value bridge (Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)
json::Value bridgeRpc (Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)
json::Value bridgeCreate (Account const &acc, json::Value const &bridge, STAmount const &reward, std::optional< STAmount > const &minAccountCreate)
json::Value bridgeModify (Account const &acc, json::Value const &bridge, std::optional< STAmount > const &reward, std::optional< STAmount > const &minAccountCreate)
json::Value xchainCreateClaimId (Account const &acc, json::Value const &bridge, STAmount const &reward, Account const &otherChainSource)
json::Value xchainCommit (Account const &acc, json::Value const &bridge, std::uint32_t claimID, AnyAmount const &amt, std::optional< Account > const &dst)
json::Value xchainClaim (Account const &acc, json::Value const &bridge, std::uint32_t claimID, AnyAmount const &amt, Account const &dst)
json::Value sidechainXchainAccountCreate (Account const &acc, json::Value const &bridge, Account const &dst, AnyAmount const &amt, AnyAmount const &reward)
json::Value claimAttestation (jtx::Account const &submittingAccount, json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, jtx::Account const &rewardAccount, bool wasLockingChainSend, std::uint64_t claimID, std::optional< jtx::Account > const &dst, jtx::Signer const &signer)
json::Value createAccountAttestation (jtx::Account const &submittingAccount, json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, jtx::AnyAmount const &rewardAmount, jtx::Account const &rewardAccount, bool wasLockingChainSend, std::uint64_t createCount, jtx::Account const &dst, jtx::Signer const &signer)
JValueVec claimAttestations (jtx::Account const &submittingAccount, json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, std::vector< jtx::Account > const &rewardAccounts, bool wasLockingChainSend, std::uint64_t claimID, std::optional< jtx::Account > const &dst, std::vector< jtx::Signer > const &signers, std::size_t const numAtts, std::size_t const fromIdx)
JValueVec createAccountAttestations (jtx::Account const &submittingAccount, json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, jtx::AnyAmount const &rewardAmount, std::vector< jtx::Account > const &rewardAccounts, bool wasLockingChainSend, std::uint64_t createCount, jtx::Account const &dst, std::vector< jtx::Signer > const &signers, std::size_t const numAtts, std::size_t const fromIdx)
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>
require_t required (Args const &... args)
 Compose many condition functors into one.
void sortSigners (std::vector< Reg > &signers)
template<typename Input>
requires requires(Input& v) { std::begin(v); std::end(v); }
auto makeVector (Input const &input)
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 checkVL (Slice const &result, std::string const &expected)
bool checkVL (SLE::const_ref sle, SField const &field, std::string const &expected)
template<class T>
std::enable_if_t< std::is_constructible_v< Account, T > > 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 &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 uSequence)
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)
json::Value sidechainXchainAccountClaim (Account const &acc, json::Value const &bridge, Account const &dst, AnyAmount const &amt)

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"
static constexpr std::array< MPTSetFlagMapping, 6 > mptSetFlagMappings
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)
static constexpr FeeLevel64 kBaseFeeLevel {TxQ::kBaseLevel}
static constexpr FeeLevel64 kMinEscalationFeeLevel = kBaseFeeLevel * 500
constexpr std::size_t kUtXchainDefaultNumSigners = 5
constexpr std::size_t kUtXchainDefaultQuorum = 4

Typedef Documentation

◆ checks

Match the number of checks on the account.

Definition at line 38 of file check.h.

◆ Holders

Definition at line 102 of file mpt.h.

◆ siglists

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

The number of signer lists matches.

Definition at line 99 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 67 of file owners.h.

◆ offers

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

Definition at line 70 of file owners.h.

◆ mptokens

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

Definition at line 73 of file owners.h.

◆ require_t

Definition at line 10 of file requires.h.

◆ requires_t

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 272 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 276 of file jtx/TestHelpers.h.

◆ tickets

Match the number of tickets on the account.

Definition at line 42 of file ticket.h.

◆ JValueVec

Enumeration Type Documentation

◆ Fund

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

Definition at line 14 of file AMMTest.h.

Function Documentation

◆ operator==() [1/2]

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

Definition at line 126 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 133 of file jtx/Account.h.

◆ operator<=>()

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

Definition at line 138 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 144 of file src/test/jtx/amount.h.

◆ operator!=()

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

Definition at line 150 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, class = std::enable_if_t<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 343 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 354 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.

◆ signClaimAttestation()

Buffer xrpl::test::jtx::signClaimAttestation ( PublicKey const & pk,
SecretKey const & sk,
STXChainBridge const & bridge,
AccountID const & sendingAccount,
STAmount const & sendingAmount,
AccountID const & rewardAccount,
bool wasLockingChainSend,
std::uint64_t claimID,
std::optional< AccountID > const & dst )

Definition at line 16 of file attester.cpp.

◆ signCreateAccountAttestation()

Buffer xrpl::test::jtx::signCreateAccountAttestation ( PublicKey const & pk,
SecretKey const & sk,
STXChainBridge const & bridge,
AccountID const & sendingAccount,
STAmount const & sendingAmount,
STAmount const & rewardAmount,
AccountID const & rewardAccount,
bool wasLockingChainSend,
std::uint64_t createCount,
AccountID const & dst )

Definition at line 33 of file attester.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 70 of file Env.h.

◆ testableAmendments()

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

Definition at line 76 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 107 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 28 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 49 of file envconfig.h.

◆ 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 64 of file envconfig.cpp.

◆ secureGateway()

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

Definition at line 72 of file envconfig.cpp.

◆ adminLocalnet()

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

Definition at line 81 of file envconfig.cpp.

◆ secureGatewayLocalnet()

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

Definition at line 89 of file envconfig.cpp.

◆ singleThreadIo()

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

Definition at line 98 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 107 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 116 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 124 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 136 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 149 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 164 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 179 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 102 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 189 of file mpt.cpp.

◆ parseSenderEncAmt()

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

Definition at line 1875 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 1903 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 70 of file TestHelpers.cpp.

◆ getAccountLines() [1/3]

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

Definition at line 78 of file TestHelpers.cpp.

◆ checkArraySize()

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

Definition at line 86 of file TestHelpers.cpp.

◆ ownerCount()

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

Definition at line 92 of file TestHelpers.cpp.

◆ stpathAppendOne() [1/3]

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

Definition at line 100 of file TestHelpers.cpp.

◆ stpathAppendOne() [2/3]

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

Definition at line 106 of file TestHelpers.cpp.

◆ equal() [1/6]

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

Definition at line 112 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 118 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 142 of file TestHelpers.cpp.

◆ pathTestEnv()

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

Definition at line 168 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 183 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 248 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 297 of file TestHelpers.cpp.

◆ txFee()

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

Definition at line 326 of file TestHelpers.cpp.

◆ xrpMinusFee()

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

Definition at line 332 of file TestHelpers.cpp.

◆ expectHolding() [1/5]

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

Definition at line 339 of file TestHelpers.cpp.

◆ expectHolding() [2/5]

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

Definition at line 369 of file TestHelpers.cpp.

◆ expectHolding() [3/5]

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

Definition at line 375 of file TestHelpers.cpp.

◆ expectHolding() [4/5]

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

Definition at line 381 of file TestHelpers.cpp.

◆ expectMPT()

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

Definition at line 389 of file TestHelpers.cpp.

◆ expectOffers()

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

Definition at line 397 of file TestHelpers.cpp.

◆ ledgerEntryRoot()

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

Definition at line 423 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 432 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 444 of file TestHelpers.cpp.

◆ ledgerEntryMPT()

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

Definition at line 453 of file TestHelpers.cpp.

◆ getBookOffers()

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

Definition at line 462 of file TestHelpers.cpp.

◆ accountBalance()

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

Definition at line 472 of file TestHelpers.cpp.

◆ expectLedgerEntryRoot()

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

Definition at line 479 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 582 of file TestHelpers.cpp.

◆ cpe()

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

Definition at line 598 of file TestHelpers.cpp.

◆ allPathElements()

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

Definition at line 611 of file TestHelpers.cpp.

◆ ipe()

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

Definition at line 617 of file TestHelpers.cpp.

◆ iape()

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

Definition at line 638 of file TestHelpers.cpp.

◆ ape()

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

Definition at line 645 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 651 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 659 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 667 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 675 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 31 of file utility.cpp.

◆ sign() [1/2]

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

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

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

Definition at line 40 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 51 of file utility.cpp.

◆ fillFee()

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

Set the fee automatically.

Definition at line 57 of file utility.cpp.

◆ fillSeq()

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

Set the sequence number automatically.

Definition at line 80 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 94 of file utility.cpp.

◆ bridge()

json::Value xrpl::test::jtx::bridge ( Account const & lockingChainDoor,
Issue const & lockingChainIssue,
Account const & issuingChainDoor,
Issue const & issuingChainIssue )

Definition at line 32 of file xchain_bridge.cpp.

◆ bridgeRpc()

json::Value xrpl::test::jtx::bridgeRpc ( Account const & lockingChainDoor,
Issue const & lockingChainIssue,
Account const & issuingChainDoor,
Issue const & issuingChainIssue )

Definition at line 48 of file xchain_bridge.cpp.

◆ bridgeCreate()

json::Value xrpl::test::jtx::bridgeCreate ( Account const & acc,
json::Value const & bridge,
STAmount const & reward,
std::optional< STAmount > const & minAccountCreate )

Definition at line 63 of file xchain_bridge.cpp.

◆ bridgeModify()

json::Value xrpl::test::jtx::bridgeModify ( Account const & acc,
json::Value const & bridge,
std::optional< STAmount > const & reward,
std::optional< STAmount > const & minAccountCreate )

Definition at line 85 of file xchain_bridge.cpp.

◆ xchainCreateClaimId()

json::Value xrpl::test::jtx::xchainCreateClaimId ( Account const & acc,
json::Value const & bridge,
STAmount const & reward,
Account const & otherChainSource )

Definition at line 108 of file xchain_bridge.cpp.

◆ xchainCommit()

json::Value xrpl::test::jtx::xchainCommit ( Account const & acc,
json::Value const & bridge,
std::uint32_t claimID,
AnyAmount const & amt,
std::optional< Account > const & dst )

Definition at line 126 of file xchain_bridge.cpp.

◆ xchainClaim()

json::Value xrpl::test::jtx::xchainClaim ( Account const & acc,
json::Value const & bridge,
std::uint32_t claimID,
AnyAmount const & amt,
Account const & dst )

Definition at line 147 of file xchain_bridge.cpp.

◆ sidechainXchainAccountCreate()

json::Value xrpl::test::jtx::sidechainXchainAccountCreate ( Account const & acc,
json::Value const & bridge,
Account const & dst,
AnyAmount const & amt,
AnyAmount const & reward )

Definition at line 167 of file xchain_bridge.cpp.

◆ claimAttestation()

json::Value xrpl::test::jtx::claimAttestation ( jtx::Account const & submittingAccount,
json::Value const & jvBridge,
jtx::Account const & sendingAccount,
jtx::AnyAmount const & sendingAmount,
jtx::Account const & rewardAccount,
bool wasLockingChainSend,
std::uint64_t claimID,
std::optional< jtx::Account > const & dst,
jtx::Signer const & signer )

Definition at line 187 of file xchain_bridge.cpp.

◆ createAccountAttestation()

json::Value xrpl::test::jtx::createAccountAttestation ( jtx::Account const & submittingAccount,
json::Value const & jvBridge,
jtx::Account const & sendingAccount,
jtx::AnyAmount const & sendingAmount,
jtx::AnyAmount const & rewardAmount,
jtx::Account const & rewardAccount,
bool wasLockingChainSend,
std::uint64_t createCount,
jtx::Account const & dst,
jtx::Signer const & signer )

Definition at line 236 of file xchain_bridge.cpp.

◆ claimAttestations()

JValueVec xrpl::test::jtx::claimAttestations ( jtx::Account const & submittingAccount,
json::Value const & jvBridge,
jtx::Account const & sendingAccount,
jtx::AnyAmount const & sendingAmount,
std::vector< jtx::Account > const & rewardAccounts,
bool wasLockingChainSend,
std::uint64_t claimID,
std::optional< jtx::Account > const & dst,
std::vector< jtx::Signer > const & signers,
std::size_t const numAtts,
std::size_t const fromIdx )

Definition at line 288 of file xchain_bridge.cpp.

◆ createAccountAttestations()

JValueVec xrpl::test::jtx::createAccountAttestations ( jtx::Account const & submittingAccount,
json::Value const & jvBridge,
jtx::Account const & sendingAccount,
jtx::AnyAmount const & sendingAmount,
jtx::AnyAmount const & rewardAmount,
std::vector< jtx::Account > const & rewardAccounts,
bool wasLockingChainSend,
std::uint64_t createCount,
jtx::Account const & dst,
std::vector< jtx::Signer > const & signers,
std::size_t const numAtts,
std::size_t const fromIdx )

Definition at line 322 of file xchain_bridge.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 40 of file mpt.h.

◆ noop()

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

The null transaction.

Definition at line 9 of file noop.h.

◆ required()

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

Compose many condition functors into one.

Definition at line 28 of file require.h.

◆ sortSigners()

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

Definition at line 41 of file SignerUtils.h.

◆ makeVector()

template<typename Input>
requires requires(Input& v) { std::begin(v); std::end(v); }
auto xrpl::test::jtx::makeVector ( Input const & input)

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

◆ getAccountOffers() [2/2]

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

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

◆ getAccountLines() [2/3]

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

Definition at line 313 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 320 of file jtx/TestHelpers.h.

◆ checkVL() [1/2]

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

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

◆ checkVL() [2/2]

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

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

◆ stpathAppendOne() [3/3]

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

Definition at line 374 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 384 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 393 of file jtx/TestHelpers.h.

◆ stpath()

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

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

◆ same()

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

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

◆ expectHolding() [5/5]

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

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

◆ strandEqualHelper() [1/2]

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

Definition at line 680 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 688 of file jtx/TestHelpers.h.

◆ equal() [6/6]

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

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

◆ getCheckIndex()

uint256 xrpl::test::jtx::getCheckIndex ( AccountID const & account,
std::uint32_t uSequence )

Definition at line 738 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 745 of file jtx/TestHelpers.h.

◆ testHelper2TokensMix()

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

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

◆ testHelper3TokensMix()

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

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

◆ sidechainXchainAccountClaim()

json::Value xrpl::test::jtx::sidechainXchainAccountClaim ( Account const & acc,
json::Value const & bridge,
Account const & dst,
AnyAmount const & amt )

Variable Documentation

◆ gAmmmpt

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

Definition at line 33 of file AMMTest.h.

◆ kJtxDropsPerXrp

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

Definition at line 58 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 373 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 104 of file envconfig.cpp.

◆ mptSetFlagMappings

std::array<MPTSetFlagMapping, 6> xrpl::test::jtx::mptSetFlagMappings
staticconstexpr
Initial value:
= {{
{.setFlag = tmfMPTSetCanLock, .ledgerFlag = lsfMPTCanLock},
{.setFlag = tmfMPTSetRequireAuth, .ledgerFlag = lsfMPTRequireAuth},
{.setFlag = tmfMPTSetCanEscrow, .ledgerFlag = lsfMPTCanEscrow},
{.setFlag = tmfMPTSetCanClawback, .ledgerFlag = lsfMPTCanClawback},
{.setFlag = tmfMPTSetCanTrade, .ledgerFlag = lsfMPTCanTrade},
{.setFlag = tmfMPTSetCanTransfer, .ledgerFlag = lsfMPTCanTransfer},
}}
constexpr FlagValue tmfMPTSetCanLock
Definition TxFlags.h:365
constexpr FlagValue tmfMPTSetCanClawback
Definition TxFlags.h:370
constexpr FlagValue tmfMPTSetCanTrade
Definition TxFlags.h:368
constexpr FlagValue tmfMPTSetCanTransfer
Definition TxFlags.h:369
constexpr FlagValue tmfMPTSetCanEscrow
Definition TxFlags.h:367
constexpr FlagValue tmfMPTSetRequireAuth
Definition TxFlags.h:366

Definition at line 103 of file mpt.cpp.

◆ kMptDexFlags

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

Definition at line 25 of file mpt.h.

◆ kMptInitNoFund

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

Definition at line 142 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 29 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 280 of file jtx/TestHelpers.h.

◆ kAmount

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

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

◆ kBaseFeeLevel

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

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

◆ kMinEscalationFeeLevel

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

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

◆ kUtXchainDefaultNumSigners

std::size_t xrpl::test::jtx::kUtXchainDefaultNumSigners = 5
constexpr

Definition at line 15 of file xchain_bridge.h.

◆ kUtXchainDefaultQuorum

std::size_t xrpl::test::jtx::kUtXchainDefaultQuorum = 4
constexpr

Definition at line 16 of file xchain_bridge.h.