rippled
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::AmendmentTable_test Class Referencefinal
Inheritance diagram for ripple::AmendmentTable_test:
Inheritance graph
[legend]
Collaboration diagram for ripple::AmendmentTable_test:
Collaboration graph
[legend]

Public Member Functions

 AmendmentTable_test ()
 
std::unique_ptr< AmendmentTablemakeTable (int w, Section const supported, Section const enabled, Section const vetoed)
 
std::unique_ptr< AmendmentTablemakeTable (int w)
 
void testConstruct ()
 
void testGet ()
 
void testBadConfig ()
 
std::map< uint256, bool > getState (AmendmentTable *table, std::set< uint256 > const &exclude)
 
void testEnableDisable ()
 
std::vector< std::pair< PublicKey, SecretKey > > makeValidators (int num)
 
void doRound (AmendmentTable &table, weeks week, std::vector< std::pair< PublicKey, SecretKey >> const &validators, std::vector< std::pair< uint256, int >> const &votes, std::vector< uint256 > &ourVotes, std::set< uint256 > &enabled, majorityAmendments_t &majority)
 
void testNoOnUnknown ()
 
void testNoOnVetoed ()
 
void testVoteEnable ()
 
void testDetectMajority ()
 
void testLostMajority ()
 
void testHasUnsupported ()
 
void run () override
 

Static Public Member Functions

static NetClock::time_point weekTime (weeks w)
 

Static Private Member Functions

static uint256 amendmentId (std::string in)
 
static std::vector< std::stringcreateSet (int group, int count)
 
static Section makeSection (std::vector< std::string > const &amendments)
 
static Section makeSection (uint256 const &amendment)
 

Private Attributes

const std::vector< std::stringm_set1
 
const std::vector< std::stringm_set2
 
const std::vector< std::stringm_set3
 
const std::vector< std::stringm_set4
 
const std::vector< std::stringm_set5
 
const Section emptySection
 
test::SuiteJournal journal
 

Static Private Attributes

static const int majorityFraction {204}
 

Detailed Description

Definition at line 35 of file AmendmentTable_test.cpp.

Constructor & Destructor Documentation

◆ AmendmentTable_test()

ripple::AmendmentTable_test::AmendmentTable_test ( )

Definition at line 91 of file AmendmentTable_test.cpp.

Member Function Documentation

◆ amendmentId()

static uint256 ripple::AmendmentTable_test::amendmentId ( std::string  in)
staticprivate

Definition at line 42 of file AmendmentTable_test.cpp.

◆ createSet()

static std::vector<std::string> ripple::AmendmentTable_test::createSet ( int  group,
int  count 
)
staticprivate

Definition at line 54 of file AmendmentTable_test.cpp.

◆ makeSection() [1/2]

static Section ripple::AmendmentTable_test::makeSection ( std::vector< std::string > const &  amendments)
staticprivate

Definition at line 64 of file AmendmentTable_test.cpp.

◆ makeSection() [2/2]

static Section ripple::AmendmentTable_test::makeSection ( uint256 const &  amendment)
staticprivate

Definition at line 73 of file AmendmentTable_test.cpp.

◆ makeTable() [1/2]

std::unique_ptr<AmendmentTable> ripple::AmendmentTable_test::makeTable ( int  w,
Section const  supported,
Section const  enabled,
Section const  vetoed 
)

Definition at line 102 of file AmendmentTable_test.cpp.

◆ makeTable() [2/2]

std::unique_ptr<AmendmentTable> ripple::AmendmentTable_test::makeTable ( int  w)

Definition at line 113 of file AmendmentTable_test.cpp.

◆ testConstruct()

void ripple::AmendmentTable_test::testConstruct ( )

Definition at line 120 of file AmendmentTable_test.cpp.

◆ testGet()

void ripple::AmendmentTable_test::testGet ( )

Definition at line 146 of file AmendmentTable_test.cpp.

◆ testBadConfig()

void ripple::AmendmentTable_test::testBadConfig ( )

Definition at line 166 of file AmendmentTable_test.cpp.

◆ getState()

std::map<uint256, bool> ripple::AmendmentTable_test::getState ( AmendmentTable table,
std::set< uint256 > const &  exclude 
)

Definition at line 260 of file AmendmentTable_test.cpp.

◆ testEnableDisable()

void ripple::AmendmentTable_test::testEnableDisable ( )

Definition at line 285 of file AmendmentTable_test.cpp.

◆ makeValidators()

std::vector<std::pair<PublicKey, SecretKey> > ripple::AmendmentTable_test::makeValidators ( int  num)

Definition at line 333 of file AmendmentTable_test.cpp.

◆ weekTime()

static NetClock::time_point ripple::AmendmentTable_test::weekTime ( weeks  w)
static

Definition at line 345 of file AmendmentTable_test.cpp.

◆ doRound()

void ripple::AmendmentTable_test::doRound ( AmendmentTable table,
weeks  week,
std::vector< std::pair< PublicKey, SecretKey >> const &  validators,
std::vector< std::pair< uint256, int >> const &  votes,
std::vector< uint256 > &  ourVotes,
std::set< uint256 > &  enabled,
majorityAmendments_t majority 
)

Definition at line 352 of file AmendmentTable_test.cpp.

◆ testNoOnUnknown()

void ripple::AmendmentTable_test::testNoOnUnknown ( )

Definition at line 451 of file AmendmentTable_test.cpp.

◆ testNoOnVetoed()

void ripple::AmendmentTable_test::testNoOnVetoed ( )

Definition at line 490 of file AmendmentTable_test.cpp.

◆ testVoteEnable()

void ripple::AmendmentTable_test::testVoteEnable ( )

Definition at line 529 of file AmendmentTable_test.cpp.

◆ testDetectMajority()

void ripple::AmendmentTable_test::testDetectMajority ( )

Definition at line 579 of file AmendmentTable_test.cpp.

◆ testLostMajority()

void ripple::AmendmentTable_test::testLostMajority ( )

Definition at line 642 of file AmendmentTable_test.cpp.

◆ testHasUnsupported()

void ripple::AmendmentTable_test::testHasUnsupported ( )

Definition at line 710 of file AmendmentTable_test.cpp.

◆ run()

void ripple::AmendmentTable_test::run ( )
override

Definition at line 743 of file AmendmentTable_test.cpp.

Member Data Documentation

◆ majorityFraction

const int ripple::AmendmentTable_test::majorityFraction {204}
staticprivate

Definition at line 39 of file AmendmentTable_test.cpp.

◆ m_set1

const std::vector<std::string> ripple::AmendmentTable_test::m_set1
private

Definition at line 80 of file AmendmentTable_test.cpp.

◆ m_set2

const std::vector<std::string> ripple::AmendmentTable_test::m_set2
private

Definition at line 81 of file AmendmentTable_test.cpp.

◆ m_set3

const std::vector<std::string> ripple::AmendmentTable_test::m_set3
private

Definition at line 82 of file AmendmentTable_test.cpp.

◆ m_set4

const std::vector<std::string> ripple::AmendmentTable_test::m_set4
private

Definition at line 83 of file AmendmentTable_test.cpp.

◆ m_set5

const std::vector<std::string> ripple::AmendmentTable_test::m_set5
private

Definition at line 84 of file AmendmentTable_test.cpp.

◆ emptySection

const Section ripple::AmendmentTable_test::emptySection
private

Definition at line 86 of file AmendmentTable_test.cpp.

◆ journal

test::SuiteJournal ripple::AmendmentTable_test::journal
private

Definition at line 88 of file AmendmentTable_test.cpp.