xrpld
Loading...
Searching...
No Matches
xrpl::test::NetworkHistory Struct Reference

Utility class for creating validators and ledger history. More...

Collaboration diagram for xrpl::test::NetworkHistory:

Classes

struct  Parameter
 Only reasonable parameters can be honored, e.g cannot hasToReEnable when nUNLSize == 0. More...

Public Types

using LedgerHistory = std::vector<std::shared_ptr<Ledger>>

Public Member Functions

 NetworkHistory (beast::unit_test::Suite &suite, Parameter const &p)
void createNodes ()
bool createLedgerHistory ()
 create ledger history and apply needed ttUNL_MODIFY tx at flag ledgers
std::shared_ptr< STValidationcreateSTVal (std::shared_ptr< Ledger const > const &ledger, NodeID const &v)
 Create a validation.
template<class NeedValidation>
void walkHistoryAndAddValidations (NeedValidation &&needVal)
 Walk the ledger history and create validation messages for the ledgers.
std::shared_ptr< Ledger const > lastLedger () const

Public Attributes

jtx::Env env
Parameter param
RCLValidationsvalidations
std::vector< PublicKeyunlKeys
hash_set< PublicKeyunlKeySet
std::vector< NodeIDunlNodeIDs
hash_set< NodeIDunlNodeIdSet
LedgerHistory history
bool goodHistory

Detailed Description

Utility class for creating validators and ledger history.

Definition at line 523 of file NegativeUNL_test.cpp.

Member Typedef Documentation

◆ LedgerHistory

Constructor & Destructor Documentation

◆ NetworkHistory()

xrpl::test::NetworkHistory::NetworkHistory ( beast::unit_test::Suite & suite,
Parameter const & p )

Definition at line 544 of file NegativeUNL_test.cpp.

Member Function Documentation

◆ createNodes()

void xrpl::test::NetworkHistory::createNodes ( )

Definition at line 554 of file NegativeUNL_test.cpp.

◆ createLedgerHistory()

bool xrpl::test::NetworkHistory::createLedgerHistory ( )

create ledger history and apply needed ttUNL_MODIFY tx at flag ledgers

Returns

Definition at line 571 of file NegativeUNL_test.cpp.

◆ createSTVal()

std::shared_ptr< STValidation > xrpl::test::NetworkHistory::createSTVal ( std::shared_ptr< Ledger const > const & ledger,
NodeID const & v )

Create a validation.

Parameters
ledgerthe ledger the validation validates
vthe validator
Returns
the validation

Definition at line 631 of file NegativeUNL_test.cpp.

◆ walkHistoryAndAddValidations()

template<class NeedValidation>
void xrpl::test::NetworkHistory::walkHistoryAndAddValidations ( NeedValidation && needVal)

Walk the ledger history and create validation messages for the ledgers.

Template Parameters
NeedValidationa function to decided if a validation is needed
Parameters
needValif a validation is needed for this particular combination of ledger and validator

Definition at line 655 of file NegativeUNL_test.cpp.

◆ lastLedger()

std::shared_ptr< Ledger const > xrpl::test::NetworkHistory::lastLedger ( ) const
nodiscard

Definition at line 677 of file NegativeUNL_test.cpp.

Member Data Documentation

◆ env

jtx::Env xrpl::test::NetworkHistory::env

Definition at line 682 of file NegativeUNL_test.cpp.

◆ param

Parameter xrpl::test::NetworkHistory::param

Definition at line 683 of file NegativeUNL_test.cpp.

◆ validations

RCLValidations& xrpl::test::NetworkHistory::validations

Definition at line 684 of file NegativeUNL_test.cpp.

◆ unlKeys

std::vector<PublicKey> xrpl::test::NetworkHistory::unlKeys

Definition at line 685 of file NegativeUNL_test.cpp.

◆ unlKeySet

hash_set<PublicKey> xrpl::test::NetworkHistory::unlKeySet

Definition at line 686 of file NegativeUNL_test.cpp.

◆ unlNodeIDs

std::vector<NodeID> xrpl::test::NetworkHistory::unlNodeIDs

Definition at line 687 of file NegativeUNL_test.cpp.

◆ unlNodeIdSet

hash_set<NodeID> xrpl::test::NetworkHistory::unlNodeIdSet

Definition at line 688 of file NegativeUNL_test.cpp.

◆ history

LedgerHistory xrpl::test::NetworkHistory::history

Definition at line 689 of file NegativeUNL_test.cpp.

◆ goodHistory

bool xrpl::test::NetworkHistory::goodHistory

Definition at line 690 of file NegativeUNL_test.cpp.