xrpld
Loading...
Searching...
No Matches
xrpl::test::EntryTestEnv Class Reference

Scaffolding shared by the per-entry-type suites. More...

#include <EntryTestHelpers.h>

Collaboration diagram for xrpl::test::EntryTestEnv:

Public Member Functions

 EntryTestEnv ()
ReadView const & read () const
 The closed ledger apply() was built over.
ApplyView & apply ()
UInt256 someID () const
 An arbitrary but stable UInt256, for the entry constructors that take an object ID directly.

Public Attributes

TxTest env
Account const alice {"alice"}
Account const bob {"bob"}
Account const carol {"carol"}

Private Member Functions

ReadView const & fundAndClose ()

Private Attributes

ApplyViewImpl av_

Detailed Description

Scaffolding shared by the per-entry-type suites.

Each of those suites needs the same three things: a ledger with a few funded accounts, a throwaway ApplyView that is never applied, and some arbitrary UInt256 to stand in for an object ID. Build one of these per test case – TxTest construction dominates the runtime of these tests by a wide margin, and none of the assertions mutate the ledger.

Definition at line 27 of file EntryTestHelpers.h.

Constructor & Destructor Documentation

◆ EntryTestEnv()

xrpl::test::EntryTestEnv::EntryTestEnv ( )

Definition at line 35 of file EntryTestHelpers.h.

Member Function Documentation

◆ read()

ReadView const & xrpl::test::EntryTestEnv::read ( ) const
nodiscard

The closed ledger apply() was built over.

Nothing here closes another ledger or submits a transaction afterward, so this and apply() never diverge.

Definition at line 45 of file EntryTestHelpers.h.

◆ apply()

ApplyView & xrpl::test::EntryTestEnv::apply ( )
nodiscard

Definition at line 51 of file EntryTestHelpers.h.

◆ someID()

UInt256 xrpl::test::EntryTestEnv::someID ( ) const
nodiscard

An arbitrary but stable UInt256, for the entry constructors that take an object ID directly.

Nothing in the ledger has this key, which is the point: those overloads should resolve to a non-existent entry.

Definition at line 62 of file EntryTestHelpers.h.

◆ fundAndClose()

ReadView const & xrpl::test::EntryTestEnv::fundAndClose ( )
private

Definition at line 71 of file EntryTestHelpers.h.

Member Data Documentation

◆ env

TxTest xrpl::test::EntryTestEnv::env

Definition at line 30 of file EntryTestHelpers.h.

◆ alice

Account const xrpl::test::EntryTestEnv::alice {"alice"}

Definition at line 31 of file EntryTestHelpers.h.

◆ bob

Account const xrpl::test::EntryTestEnv::bob {"bob"}

Definition at line 32 of file EntryTestHelpers.h.

◆ carol

Account const xrpl::test::EntryTestEnv::carol {"carol"}

Definition at line 33 of file EntryTestHelpers.h.

◆ av_

ApplyViewImpl xrpl::test::EntryTestEnv::av_
private

Definition at line 80 of file EntryTestHelpers.h.