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

Helpers for constructing Batch test transactions. More...

Classes

class  Inner
 Adds an inner Batch transaction to a JTx and autofills it. More...
class  Sig
 Sets the Batch transaction signers on a JTx. More...
class  Msig
 Sets a nested multi-signature for a Batch transaction on a JTx. More...

Functions

XRPAmount calcBatchFee (jtx::Env const &env, uint32_t const &numSigners, uint32_t const &txns=0)
 Calculate the expected outer Batch transaction fee.
XRPAmount calcConfidentialBatchFee (jtx::Env const &env, uint32_t const &numSigners, uint32_t const &txns=0)
 Calculate the expected Batch fee when inner transactions are confidential MPT transactions.
json::Value outer (jtx::Account const &account, uint32_t seq, STAmount const &fee, std::uint32_t flags)
 Build an outer Batch transaction JSON object.
void validateInnerTxn (Env &env, std::string const &batchID, std::string const &txHash, std::string const &txType, std::string const &result, std::source_location const &loc=std::source_location::current())
 Expect an inner Batch transaction to be recorded with the given type and result, and with ParentBatchID pointing at its outer Batch.

Detailed Description

Helpers for constructing Batch test transactions.

Function Documentation

◆ calcBatchFee()

XRPAmount xrpl::test::jtx::batch::calcBatchFee ( jtx::Env const & env,
uint32_t const & numSigners,
uint32_t const & txns = 0 )

Calculate the expected outer Batch transaction fee.

Parameters
envThe test environment providing ledger fee settings.
numSignersNumber of outer transaction signers.
txnsNumber of inner transactions in the batch.
Returns
The expected Batch fee.

Definition at line 37 of file batch.cpp.

◆ calcConfidentialBatchFee()

XRPAmount xrpl::test::jtx::batch::calcConfidentialBatchFee ( jtx::Env const & env,
uint32_t const & numSigners,
uint32_t const & txns = 0 )

Calculate the expected Batch fee when inner transactions are confidential MPT transactions.

Parameters
envThe test environment providing ledger fee settings.
numSignersNumber of outer transaction signers.
txnsNumber of confidential MPT inner transactions in the batch.
Returns
The expected Batch fee including confidential transaction fee multipliers.

Definition at line 44 of file batch.cpp.

◆ outer()

json::Value xrpl::test::jtx::batch::outer ( jtx::Account const & account,
uint32_t seq,
STAmount const & fee,
std::uint32_t flags )

Build an outer Batch transaction JSON object.

Parameters
accountThe account submitting the outer Batch transaction.
seqThe sequence number for the outer Batch transaction.
feeThe fee to set on the outer Batch transaction.
flagsThe transaction flags to set.
Returns
The outer Batch transaction JSON object.

Definition at line 55 of file batch.cpp.

◆ validateInnerTxn()

void xrpl::test::jtx::batch::validateInnerTxn ( Env & env,
std::string const & batchID,
std::string const & txHash,
std::string const & txType,
std::string const & result,
std::source_location const & loc = std::source_location::current() )

Expect an inner Batch transaction to be recorded with the given type and result, and with ParentBatchID pointing at its outer Batch.

Looks the inner transaction up with the tx RPC, so the ledger holding the batch must already be closed. Failures are reported at the caller's line.

Parameters
envThe test environment.
batchIDHash of the outer Batch transaction.
txHashHash of the inner transaction.
txTypeExpected TransactionType, e.g. "Payment".
resultExpected TransactionResult, e.g. "tesSUCCESS".
locCall site to report failures at.

Definition at line 68 of file batch.cpp.