rippled
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ripple::test::NetworkHistory Struct Reference

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

Collaboration diagram for ripple::test::NetworkHistory:
Collaboration graph
[legend]

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 More...
 
std::shared_ptr< STValidationcreateSTVal (std::shared_ptr< Ledger const > const &ledger, NodeID const &v)
 Create a validation. More...
 
template<class NeedValidation >
void walkHistoryAndAddValidations (NeedValidation &&needVal)
 Walk the ledger history and create validation messages for the ledgers. More...
 
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 562 of file NegativeUNL_test.cpp.

Member Typedef Documentation

◆ LedgerHistory

Definition at line 564 of file NegativeUNL_test.cpp.

Constructor & Destructor Documentation

◆ NetworkHistory()

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

Definition at line 583 of file NegativeUNL_test.cpp.

Member Function Documentation

◆ createNodes()

void ripple::test::NetworkHistory::createNodes ( )

Definition at line 595 of file NegativeUNL_test.cpp.

◆ createLedgerHistory()

bool ripple::test::NetworkHistory::createLedgerHistory ( )

create ledger history and apply needed ttUNL_MODIFY tx at flag ledgers

Returns

Definition at line 612 of file NegativeUNL_test.cpp.

◆ createSTVal()

std::shared_ptr<STValidation> ripple::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 673 of file NegativeUNL_test.cpp.

◆ walkHistoryAndAddValidations()

template<class NeedValidation >
void ripple::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 697 of file NegativeUNL_test.cpp.

◆ lastLedger()

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

Definition at line 719 of file NegativeUNL_test.cpp.

Member Data Documentation

◆ env

jtx::Env ripple::test::NetworkHistory::env

Definition at line 724 of file NegativeUNL_test.cpp.

◆ param

Parameter ripple::test::NetworkHistory::param

Definition at line 725 of file NegativeUNL_test.cpp.

◆ validations

RCLValidations& ripple::test::NetworkHistory::validations

Definition at line 726 of file NegativeUNL_test.cpp.

◆ UNLKeys

std::vector<PublicKey> ripple::test::NetworkHistory::UNLKeys

Definition at line 727 of file NegativeUNL_test.cpp.

◆ UNLKeySet

hash_set<PublicKey> ripple::test::NetworkHistory::UNLKeySet

Definition at line 728 of file NegativeUNL_test.cpp.

◆ UNLNodeIDs

std::vector<NodeID> ripple::test::NetworkHistory::UNLNodeIDs

Definition at line 729 of file NegativeUNL_test.cpp.

◆ UNLNodeIDSet

hash_set<NodeID> ripple::test::NetworkHistory::UNLNodeIDSet

Definition at line 730 of file NegativeUNL_test.cpp.

◆ history

LedgerHistory ripple::test::NetworkHistory::history

Definition at line 731 of file NegativeUNL_test.cpp.

◆ goodHistory

bool ripple::test::NetworkHistory::goodHistory

Definition at line 732 of file NegativeUNL_test.cpp.