rippled
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
xrpl::test::jtx::Env Class Reference

A transaction testing environment. More...

#include <Env.h>

Collaboration diagram for xrpl::test::jtx::Env:
Collaboration graph
[legend]

Classes

struct  AppBundle
 
struct  ParsedResult
 Used by parseResult() and postConditions() More...
 

Public Member Functions

 Env ()=delete
 
Envoperator= (Env const &)=delete
 
 Env (Env const &)=delete
 
 Env (beast::unit_test::suite &suite_, std::unique_ptr< Config > config, FeatureBitset features, std::unique_ptr< Logs > logs=nullptr, beast::severities::Severity thresh=beast::severities::kError)
 Create Env using suite, Config pointer, and explicit features.
 
 Env (beast::unit_test::suite &suite_, FeatureBitset features, std::unique_ptr< Logs > logs=nullptr)
 Create Env with default config and specified features.
 
 Env (beast::unit_test::suite &suite_, std::unique_ptr< Config > config, std::unique_ptr< Logs > logs=nullptr, beast::severities::Severity thresh=beast::severities::kError)
 Create Env using suite and Config pointer.
 
 Env (beast::unit_test::suite &suite_, beast::severities::Severity thresh=beast::severities::kError)
 Create Env with only the current test suite.
 
virtual ~Env ()=default
 
Applicationapp ()
 
Application const & app () const
 
ManualTimeKeepertimeKeeper ()
 
NetClock::time_point now ()
 Returns the current network time.
 
AbstractClientclient ()
 Returns the connected client.
 
template<class... Args>
Json::Value rpc (unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
 Execute an RPC command.
 
template<class... Args>
Json::Value rpc (unsigned apiVersion, std::string const &cmd, Args &&... args)
 
template<class... Args>
Json::Value rpc (std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
 
template<class... Args>
Json::Value rpc (std::string const &cmd, Args &&... args)
 
std::shared_ptr< OpenView const > current () const
 Returns the current ledger.
 
std::shared_ptr< ReadView const > closed ()
 Returns the last closed ledger.
 
bool close (NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
 Close and advance the ledger.
 
template<class Rep , class Period >
bool close (std::chrono::duration< Rep, Period > const &elapsed)
 Close and advance the ledger.
 
bool close ()
 Close and advance the ledger.
 
bool syncClose (std::chrono::steady_clock::duration timeout=std::chrono::seconds{1})
 Close and advance the ledger, then synchronize with the server's io_context to ensure all async operations initiated by the close have been started.
 
void trace (int howMany=-1)
 Turn on JSON tracing.
 
void notrace ()
 Turn off JSON tracing.
 
void set_parse_failure_expected (bool b)
 
void disable_sigs ()
 Turn off signature checks.
 
void set_retries (unsigned r=5)
 
unsigned retries () const
 
void memoize (Account const &account)
 Associate AccountID with account.
 
PrettyAmount balance (Account const &account) const
 Returns the XRP balance on an account.
 
std::uint32_t seq (Account const &account) const
 Returns the next sequence number on account.
 
PrettyAmount balance (Account const &account, Asset const &asset) const
 Return the balance on an account.
 
PrettyAmount balance (Account const &account, Issue const &issue) const
 
PrettyAmount balance (Account const &account, MPTIssue const &mptIssue) const
 
PrettyAmount limit (Account const &account, Issue const &issue) const
 Returns the IOU limit on an account.
 
std::uint32_t ownerCount (Account const &account) const
 Return the number of objects owned by an account.
 
std::shared_ptr< SLE const > le (Account const &account) const
 Return an account root.
 
std::shared_ptr< SLE const > le (Keylet const &k) const
 Return a ledger entry.
 
template<class JsonValue , class... FN>
JTx jt (JsonValue &&jv, FN const &... fN)
 Create a JTx from parameters.
 
template<class JsonValue , class... FN>
JTx jtnofill (JsonValue &&jv, FN const &... fN)
 Create a JTx from parameters.
 
template<class JsonValue , class... FN>
Json::Value json (JsonValue &&jv, FN const &... fN)
 Create JSON from parameters.
 
template<class... Args>
void require (Args const &... args)
 Check a set of requirements.
 
virtual void submit (JTx const &jt, std::source_location const &loc=std::source_location::current())
 Submit an existing JTx.
 
void sign_and_submit (JTx const &jt, Json::Value params=Json::nullValue, std::source_location const &loc=std::source_location::current())
 Use the submit RPC command with a provided JTx object.
 
void postconditions (JTx const &jt, ParsedResult const &parsed, Json::Value const &jr=Json::Value(), std::source_location const &loc=std::source_location::current())
 Check expected postconditions of JTx submission.
 
TER ter () const
 Return the TER for the last JTx.
 
std::shared_ptr< STObject const > meta ()
 Return metadata for the last JTx.
 
std::shared_ptr< STTx const > tx () const
 Return the tx data for the last JTx.
 
void enableFeature (uint256 const feature)
 
void disableFeature (uint256 const feature)
 
bool enabled (uint256 feature) const
 
template<class Arg , class... Args>
void fund (STAmount const &amount, Arg const &arg, Args const &... args)
 Create a new account with some XRP.
 
std::shared_ptr< STTx const > ust (JTx const &jt)
 Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by first editing the JSON.
 
Account const & lookup (AccountID const &id) const
 Returns the Account given the AccountID.
 
Account const & lookup (std::string const &base58ID) const
 
template<class... FN>
Envapply (WithSourceLocation< Json::Value > jv, FN const &... fN)
 Apply funclets and submit.
 
template<class... FN>
Envapply (WithSourceLocation< JTx > jv, FN const &... fN)
 
template<class... FN>
Envoperator() (WithSourceLocation< Json::Value > jv, FN const &... fN)
 
template<class... FN>
Envoperator() (WithSourceLocation< JTx > jv, FN const &... fN)
 
void trust (STAmount const &amount, Account const &account)
 Establish trust lines.
 
template<class... Accounts>
void trust (STAmount const &amount, Account const &to0, Account const &to1, Accounts const &... toN)
 

Static Public Member Functions

static ParsedResult parseResult (Json::Value const &jr)
 Gets the TER result and didApply flag from a RPC Json result object.
 

Public Attributes

beast::unit_test::suitetest
 
Account const & master = Account::master
 
beast::Journal const journal
 

Protected Member Functions

Json::Value do_rpc (unsigned apiVersion, std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
 
void autofill_sig (JTx &jt)
 
virtual void autofill (JTx &jt)
 
std::shared_ptr< STTx const > st (JTx const &jt)
 Create a STTx from a JTx The framework requires that JSON is valid.
 
template<class... FN>
void invoke (STTx &stx, FN const &... fN)
 
template<class... FN>
void invoke (JTx &jt, FN const &... fN)
 

Protected Attributes

int trace_ = 0
 
TestStopwatch stopwatch_
 
uint256 txid_
 
TER ter_ = tesSUCCESS
 
bool parseFailureExpected_ = false
 
unsigned retries_ = 5
 
std::unordered_map< AccountID, Accountmap_
 

Private Member Functions

void fund (bool setDefaultRipple, STAmount const &amount, Account const &account)
 
void fund_arg (STAmount const &amount, Account const &account)
 
template<std::size_t N>
void fund_arg (STAmount const &amount, std::array< Account, N > const &list)
 

Private Attributes

AppBundle bundle_
 

Detailed Description

A transaction testing environment.

Definition at line 121 of file Env.h.

Constructor & Destructor Documentation

◆ Env() [1/6]

xrpl::test::jtx::Env::Env ( )
delete

◆ Env() [2/6]

xrpl::test::jtx::Env::Env ( Env const &  )
delete

◆ Env() [3/6]

xrpl::test::jtx::Env::Env ( beast::unit_test::suite suite_,
std::unique_ptr< Config config,
FeatureBitset  features,
std::unique_ptr< Logs logs = nullptr,
beast::severities::Severity  thresh = beast::severities::kError 
)

Create Env using suite, Config pointer, and explicit features.

This constructor will create an Env with the specified configuration and takes ownership the passed Config pointer. Features will be enabled according to rules described below (see next constructor).

Parameters
suite_the current unit_test::suite
configThe desired Config - ownership will be taken by moving the pointer. See envconfig and related functions for common config tweaks.
argswith_only_features() to explicitly enable or supported_features_except() to enable all and disable specific features.

Definition at line 185 of file Env.h.

◆ Env() [4/6]

xrpl::test::jtx::Env::Env ( beast::unit_test::suite suite_,
FeatureBitset  features,
std::unique_ptr< Logs logs = nullptr 
)

Create Env with default config and specified features.

This constructor will create an Env with the standard Env configuration (from envconfig()) and features explicitly specified. Use with_only_features(...) or supported_features_except(...) to create a collection of features appropriate for passing here.

Parameters
suite_the current unit_test::suite
argscollection of features

Definition at line 214 of file Env.h.

◆ Env() [5/6]

xrpl::test::jtx::Env::Env ( beast::unit_test::suite suite_,
std::unique_ptr< Config config,
std::unique_ptr< Logs logs = nullptr,
beast::severities::Severity  thresh = beast::severities::kError 
)

Create Env using suite and Config pointer.

This constructor will create an Env with the specified configuration and takes ownership the passed Config pointer. All supported amendments are enabled by this version of the constructor.

Parameters
suite_the current unit_test::suite
configThe desired Config - ownership will be taken by moving the pointer. See envconfig and related functions for common config tweaks.

Definition at line 233 of file Env.h.

◆ Env() [6/6]

xrpl::test::jtx::Env::Env ( beast::unit_test::suite suite_,
beast::severities::Severity  thresh = beast::severities::kError 
)

Create Env with only the current test suite.

This constructor will create an Env with the standard test Env configuration (from envconfig()) and all supported amendments enabled.

Parameters
suite_the current unit_test::suite

Definition at line 250 of file Env.h.

◆ ~Env()

virtual xrpl::test::jtx::Env::~Env ( )
virtualdefault

Member Function Documentation

◆ operator=()

Env & xrpl::test::jtx::Env::operator= ( Env const &  )
delete

◆ app() [1/2]

Application & xrpl::test::jtx::Env::app ( )

Definition at line 259 of file Env.h.

◆ app() [2/2]

Application const & xrpl::test::jtx::Env::app ( ) const

Definition at line 265 of file Env.h.

◆ timeKeeper()

ManualTimeKeeper & xrpl::test::jtx::Env::timeKeeper ( )

Definition at line 271 of file Env.h.

◆ now()

NetClock::time_point xrpl::test::jtx::Env::now ( )

Returns the current network time.

Note
This is manually advanced when ledgers close or by callers.

Definition at line 282 of file Env.h.

◆ client()

AbstractClient & xrpl::test::jtx::Env::client ( )

Returns the connected client.

Definition at line 289 of file Env.h.

◆ rpc() [1/4]

template<class... Args>
Json::Value xrpl::test::jtx::Env::rpc ( unsigned  apiVersion,
std::unordered_map< std::string, std::string > const &  headers,
std::string const &  cmd,
Args &&...  args 
)

Execute an RPC command.

The command is examined and used to build the correct JSON as per the arguments.

Definition at line 847 of file Env.h.

◆ rpc() [2/4]

template<class... Args>
Json::Value xrpl::test::jtx::Env::rpc ( unsigned  apiVersion,
std::string const &  cmd,
Args &&...  args 
)

Definition at line 858 of file Env.h.

◆ rpc() [3/4]

template<class... Args>
Json::Value xrpl::test::jtx::Env::rpc ( std::unordered_map< std::string, std::string > const &  headers,
std::string const &  cmd,
Args &&...  args 
)

Definition at line 869 of file Env.h.

◆ rpc() [4/4]

template<class... Args>
Json::Value xrpl::test::jtx::Env::rpc ( std::string const &  cmd,
Args &&...  args 
)

Definition at line 882 of file Env.h.

◆ current()

std::shared_ptr< OpenView const > xrpl::test::jtx::Env::current ( ) const

Returns the current ledger.

This is a non-modifiable snapshot of the open ledger at the moment of the call. Transactions applied after the call to open() will not be visible.

Definition at line 329 of file Env.h.

◆ closed()

std::shared_ptr< ReadView const > xrpl::test::jtx::Env::closed ( )

Returns the last closed ledger.

The open ledger is built on top of the last closed ledger. When the open ledger is closed, it becomes the new closed ledger and a new open ledger takes its place.

Definition at line 94 of file Env.cpp.

◆ close() [1/3]

bool xrpl::test::jtx::Env::close ( NetClock::time_point  closeTime,
std::optional< std::chrono::milliseconds consensusDelay = std::nullopt 
)

Close and advance the ledger.

The resulting close time will be different and greater than the previous close time, and at or after the passed-in close time.

Effects:

Creates a new closed ledger from the last
closed ledger.

All transactions that made it into the open
ledger are applied to the closed ledger.

The Application network time is set to
the close time of the resulting ledger.
Returns
true if no error, false if error

Definition at line 100 of file Env.cpp.

◆ close() [2/3]

template<class Rep , class Period >
bool xrpl::test::jtx::Env::close ( std::chrono::duration< Rep, Period > const &  elapsed)

Close and advance the ledger.

The time is calculated as the duration from the previous ledger closing time.

Returns
true if no error, false if error

Definition at line 377 of file Env.h.

◆ close() [3/3]

bool xrpl::test::jtx::Env::close ( )

Close and advance the ledger.

The time is calculated as five seconds from the previous ledger closing time.

Returns
true if no error, false if error

Definition at line 391 of file Env.h.

◆ syncClose()

bool xrpl::test::jtx::Env::syncClose ( std::chrono::steady_clock::duration  timeout = std::chrono::seconds{1})

Close and advance the ledger, then synchronize with the server's io_context to ensure all async operations initiated by the close have been started.

This function performs the same ledger close as close(), but additionally ensures that all tasks posted to the server's io_context (such as WebSocket subscription message sends) have been initiated before returning.

What it guarantees:

  • All async operations posted before syncClose() have been STARTED
  • For WebSocket sends: async_write_some() has been called
  • The actual I/O completion may still be pending (async)

What it does NOT guarantee:

  • Async operations have COMPLETED
  • WebSocket messages have been received by clients
  • However, for localhost connections, the remaining latency is typically microseconds, making tests reliable

Use this instead of close() when:

  • Test code immediately checks for subscription messages
  • Race conditions between test and worker threads must be avoided
  • Deterministic test behavior is required
Parameters
timeoutMaximum time to wait for the barrier task to execute
Returns
true if close succeeded and barrier executed within timeout, false otherwise

Definition at line 426 of file Env.h.

◆ trace()

void xrpl::test::jtx::Env::trace ( int  howMany = -1)

Turn on JSON tracing.

With no arguments, trace all

Definition at line 443 of file Env.h.

◆ notrace()

void xrpl::test::jtx::Env::notrace ( )

Turn off JSON tracing.

Definition at line 450 of file Env.h.

◆ set_parse_failure_expected()

void xrpl::test::jtx::Env::set_parse_failure_expected ( bool  b)

Definition at line 456 of file Env.h.

◆ disable_sigs()

void xrpl::test::jtx::Env::disable_sigs ( )

Turn off signature checks.

Definition at line 463 of file Env.h.

◆ set_retries()

void xrpl::test::jtx::Env::set_retries ( unsigned  r = 5)

Definition at line 470 of file Env.h.

◆ retries()

unsigned xrpl::test::jtx::Env::retries ( ) const

Definition at line 477 of file Env.h.

◆ memoize()

void xrpl::test::jtx::Env::memoize ( Account const &  account)

Associate AccountID with account.

Definition at line 141 of file Env.cpp.

◆ lookup() [1/2]

Account const & xrpl::test::jtx::Env::lookup ( AccountID const &  id) const

Returns the Account given the AccountID.

Definition at line 147 of file Env.cpp.

◆ lookup() [2/2]

Account const & xrpl::test::jtx::Env::lookup ( std::string const &  base58ID) const

Definition at line 159 of file Env.cpp.

◆ balance() [1/4]

PrettyAmount xrpl::test::jtx::Env::balance ( Account const &  account) const

Returns the XRP balance on an account.

Returns 0 if the account does not exist.

Definition at line 168 of file Env.cpp.

◆ seq()

std::uint32_t xrpl::test::jtx::Env::seq ( Account const &  account) const

Returns the next sequence number on account.

Exceptions: Throws if the account does not exist

Definition at line 249 of file Env.cpp.

◆ balance() [2/4]

PrettyAmount xrpl::test::jtx::Env::balance ( Account const &  account,
Asset const &  asset 
) const

Return the balance on an account.

Returns 0 if the trust line does not exist.

Definition at line 222 of file Env.cpp.

◆ balance() [3/4]

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

Definition at line 177 of file Env.cpp.

◆ balance() [4/4]

PrettyAmount xrpl::test::jtx::Env::balance ( Account const &  account,
MPTIssue const &  mptIssue 
) const

Definition at line 192 of file Env.cpp.

◆ limit()

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

Returns the IOU limit on an account.

Returns 0 if the trust line does not exist.

Definition at line 228 of file Env.cpp.

◆ ownerCount()

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

Return the number of objects owned by an account.

Returns 0 if the account does not exist.

Definition at line 240 of file Env.cpp.

◆ le() [1/2]

std::shared_ptr< SLE const > xrpl::test::jtx::Env::le ( Account const &  account) const

Return an account root.

Returns
empty if the account does not exist.

Definition at line 258 of file Env.cpp.

◆ le() [2/2]

std::shared_ptr< SLE const > xrpl::test::jtx::Env::le ( Keylet const &  k) const

Return a ledger entry.

Returns
empty if the ledger entry does not exist

Definition at line 264 of file Env.cpp.

◆ jt()

template<class JsonValue , class... FN>
JTx xrpl::test::jtx::Env::jt ( JsonValue &&  jv,
FN const &...  fN 
)

Create a JTx from parameters.

Definition at line 549 of file Env.h.

◆ jtnofill()

template<class JsonValue , class... FN>
JTx xrpl::test::jtx::Env::jtnofill ( JsonValue &&  jv,
FN const &...  fN 
)

Create a JTx from parameters.

Definition at line 561 of file Env.h.

◆ json()

template<class JsonValue , class... FN>
Json::Value xrpl::test::jtx::Env::json ( JsonValue &&  jv,
FN const &...  fN 
)

Create JSON from parameters.

This will apply funclets and autofill.

Definition at line 575 of file Env.h.

◆ require()

template<class... Args>
void xrpl::test::jtx::Env::require ( Args const &...  args)

Check a set of requirements.

The requirements are formed from condition functors.

Definition at line 588 of file Env.h.

◆ parseResult()

Env::ParsedResult xrpl::test::jtx::Env::parseResult ( Json::Value const &  jr)
static

Gets the TER result and didApply flag from a RPC Json result object.

Definition at line 318 of file Env.cpp.

◆ submit()

void xrpl::test::jtx::Env::submit ( JTx const &  jt,
std::source_location const &  loc = std::source_location::current() 
)
virtual

Submit an existing JTx.

This calls postconditions.

Definition at line 359 of file Env.cpp.

◆ sign_and_submit()

void xrpl::test::jtx::Env::sign_and_submit ( JTx const &  jt,
Json::Value  params = Json::nullValue,
std::source_location const &  loc = std::source_location::current() 
)

Use the submit RPC command with a provided JTx object.

This calls postconditions.

Definition at line 387 of file Env.cpp.

◆ postconditions()

void xrpl::test::jtx::Env::postconditions ( JTx const &  jt,
ParsedResult const &  parsed,
Json::Value const &  jr = Json::Value(),
std::source_location const &  loc = std::source_location::current() 
)

Check expected postconditions of JTx submission.

Definition at line 425 of file Env.cpp.

◆ apply() [1/2]

template<class... FN>
Env & xrpl::test::jtx::Env::apply ( WithSourceLocation< Json::Value jv,
FN const &...  fN 
)

Apply funclets and submit.

Definition at line 627 of file Env.h.

◆ apply() [2/2]

template<class... FN>
Env & xrpl::test::jtx::Env::apply ( WithSourceLocation< JTx jv,
FN const &...  fN 
)

Definition at line 635 of file Env.h.

◆ operator()() [1/2]

template<class... FN>
Env & xrpl::test::jtx::Env::operator() ( WithSourceLocation< Json::Value jv,
FN const &...  fN 
)

Definition at line 643 of file Env.h.

◆ operator()() [2/2]

template<class... FN>
Env & xrpl::test::jtx::Env::operator() ( WithSourceLocation< JTx jv,
FN const &...  fN 
)

Definition at line 650 of file Env.h.

◆ ter()

TER xrpl::test::jtx::Env::ter ( ) const

Return the TER for the last JTx.

Definition at line 658 of file Env.h.

◆ meta()

std::shared_ptr< STObject const > xrpl::test::jtx::Env::meta ( )

Return metadata for the last JTx.

NOTE: this has a side effect of closing the open ledger. The ledger will only be closed if it includes transactions.

Effects:

The open ledger is closed as if by a call
to close(). The metadata for the last
transaction ID, if any, is returned.

Definition at line 483 of file Env.cpp.

◆ tx()

std::shared_ptr< STTx const > xrpl::test::jtx::Env::tx ( ) const

Return the tx data for the last JTx.

Effects:

The tx data for the last transaction
ID, if any, is returned. No side
effects.
Note
Only necessary for JTx submitted with via sign-and-submit method.

Definition at line 505 of file Env.cpp.

◆ enableFeature()

void xrpl::test::jtx::Env::enableFeature ( uint256 const  feature)

Definition at line 654 of file Env.cpp.

◆ disableFeature()

void xrpl::test::jtx::Env::disableFeature ( uint256 const  feature)

Definition at line 662 of file Env.cpp.

◆ enabled()

bool xrpl::test::jtx::Env::enabled ( uint256  feature) const

Definition at line 698 of file Env.h.

◆ fund() [1/2]

void xrpl::test::jtx::Env::fund ( bool  setDefaultRipple,
STAmount const &  amount,
Account const &  account 
)
private

Definition at line 270 of file Env.cpp.

◆ fund_arg() [1/2]

void xrpl::test::jtx::Env::fund_arg ( STAmount const &  amount,
Account const &  account 
)
private

Definition at line 708 of file Env.h.

◆ fund_arg() [2/2]

template<std::size_t N>
void xrpl::test::jtx::Env::fund_arg ( STAmount const &  amount,
std::array< Account, N > const &  list 
)
private

Definition at line 715 of file Env.h.

◆ fund() [2/2]

template<class Arg , class... Args>
void xrpl::test::jtx::Env::fund ( STAmount const &  amount,
Arg const &  arg,
Args const &...  args 
)

Create a new account with some XRP.

These convenience functions are for easy set-up of the environment, they bypass fee, seq, and sig settings. The XRP is transferred from the master account.

Preconditions: The account must not already exist

Effects: The asfDefaultRipple on the account is set, and the sequence number is incremented, unless the account is wrapped with a call to noripple.

The account's XRP balance is set to amount.

Generates a test that the balance is set.

Parameters
amountThe amount of XRP to transfer to each account.
argsA heterogeneous list of accounts to fund or calls to noripple with lists of accounts to fund.

Definition at line 750 of file Env.h.

◆ trust() [1/2]

void xrpl::test::jtx::Env::trust ( STAmount const &  amount,
Account const &  account 
)

Establish trust lines.

These convenience functions are for easy set-up of the environment, they bypass fee, seq, and sig settings.

Preconditions: The account must already exist

Effects: A trust line is added for the account. The account's sequence number is incremented. The account is refunded for the transaction fee to set the trust line.

The refund comes from the master account.

Definition at line 301 of file Env.cpp.

◆ trust() [2/2]

template<class... Accounts>
void xrpl::test::jtx::Env::trust ( STAmount const &  amount,
Account const &  to0,
Account const &  to1,
Accounts const &...  toN 
)

Definition at line 780 of file Env.h.

◆ ust()

std::shared_ptr< STTx const > xrpl::test::jtx::Env::ust ( JTx const &  jt)

Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by first editing the JSON.

Definition at line 609 of file Env.cpp.

◆ do_rpc()

Json::Value xrpl::test::jtx::Env::do_rpc ( unsigned  apiVersion,
std::vector< std::string > const &  args,
std::unordered_map< std::string, std::string > const &  headers = {} 
)
protected

Definition at line 635 of file Env.cpp.

◆ autofill_sig()

void xrpl::test::jtx::Env::autofill_sig ( JTx jt)
protected

Definition at line 511 of file Env.cpp.

◆ autofill()

void xrpl::test::jtx::Env::autofill ( JTx jt)
protectedvirtual

Definition at line 554 of file Env.cpp.

◆ st()

std::shared_ptr< STTx const > xrpl::test::jtx::Env::st ( JTx const &  jt)
protected

Create a STTx from a JTx The framework requires that JSON is valid.

On a parse error, the JSON is logged and an exception thrown. Throws: parse_error

Definition at line 583 of file Env.cpp.

◆ invoke() [1/2]

template<class... FN>
void xrpl::test::jtx::Env::invoke ( STTx stx,
FN const &...  fN 
)
protected

Definition at line 828 of file Env.h.

◆ invoke() [2/2]

template<class... FN>
void xrpl::test::jtx::Env::invoke ( JTx jt,
FN const &...  fN 
)
protected

Definition at line 836 of file Env.h.

Member Data Documentation

◆ test

beast::unit_test::suite& xrpl::test::jtx::Env::test

Definition at line 124 of file Env.h.

◆ master

Account const& xrpl::test::jtx::Env::master = Account::master

Definition at line 126 of file Env.h.

◆ bundle_

AppBundle xrpl::test::jtx::Env::bundle_
private

Definition at line 160 of file Env.h.

◆ journal

beast::Journal const xrpl::test::jtx::Env::journal

Definition at line 163 of file Env.h.

◆ trace_

int xrpl::test::jtx::Env::trace_ = 0
protected

Definition at line 795 of file Env.h.

◆ stopwatch_

TestStopwatch xrpl::test::jtx::Env::stopwatch_
protected

Definition at line 796 of file Env.h.

◆ txid_

uint256 xrpl::test::jtx::Env::txid_
protected

Definition at line 797 of file Env.h.

◆ ter_

TER xrpl::test::jtx::Env::ter_ = tesSUCCESS
protected

Definition at line 798 of file Env.h.

◆ parseFailureExpected_

bool xrpl::test::jtx::Env::parseFailureExpected_ = false
protected

Definition at line 799 of file Env.h.

◆ retries_

unsigned xrpl::test::jtx::Env::retries_ = 5
protected

Definition at line 800 of file Env.h.

◆ map_

std::unordered_map<AccountID, Account> xrpl::test::jtx::Env::map_
protected

Definition at line 842 of file Env.h.