hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::consensus::yac::YacVoteStorage Class Reference

#include "yac_vote_storage.hpp"

Collaboration diagram for iroha::consensus::yac::YacVoteStorage:
Collaboration graph

Public Member Functions

 YacVoteStorage (std::shared_ptr< CleanupStrategy > cleanup_strategy, std::unique_ptr< SupermajorityChecker > supermajority_checker, logger::LoggerManagerTreePtr log_manager)
 
boost::optional< Answerstore (std::vector< VoteMessage > state, PeersNumberType peers_in_round)
 
bool isCommitted (const Round &round)
 
ProposalState getProcessingState (const Round &round)
 
void nextProcessingState (const Round &round)
 
boost::optional< RoundgetLastFinalizedRound () const
 
boost::optional< AnswergetState (const Round &round) const
 

Detailed Description

Class provide storage for votes and useful methods for it.

Constructor & Destructor Documentation

iroha::consensus::yac::YacVoteStorage::YacVoteStorage ( std::shared_ptr< CleanupStrategy cleanup_strategy,
std::unique_ptr< SupermajorityChecker supermajority_checker,
logger::LoggerManagerTreePtr  log_manager 
)
Parameters
cleanup_strategy- strategy for removing elements from storage
consistency_model- consensus consistency model (CFT, BFT).
log_manager- log manager to create component loggers

Member Function Documentation

boost::optional< Round > iroha::consensus::yac::YacVoteStorage::getLastFinalizedRound ( ) const

Get last by order finalized round

Returns
round if it exists

Here is the caller graph for this function:

ProposalState iroha::consensus::yac::YacVoteStorage::getProcessingState ( const Round round)

Method provide state of processing for concrete proposal/block

Parameters
round,inwhich that proposal/block is being voted
Returns
value attached to parameter's round. Default is kNotSentNotProcessed.

Here is the caller graph for this function:

boost::optional< Answer > iroha::consensus::yac::YacVoteStorage::getState ( const Round round) const

Get the state attached of a past round

Parameters
round- required round
Returns
state if round exists and finalized

Here is the caller graph for this function:

bool iroha::consensus::yac::YacVoteStorage::isCommitted ( const Round round)

Provide status about closing round of proposal/block

Parameters
round,inwhich proposal/block is supposed to be committed
Returns
true, if round closed

Here is the caller graph for this function:

void iroha::consensus::yac::YacVoteStorage::nextProcessingState ( const Round round)

Mark round with following transition: kNotSentNotProcessed -> kSentNotProcessed kSentNotProcessed -> kSentProcessed kSentProcessed -> kSentProcessed

See also
ProposalState description for transition cases
Parameters
round- target tag

Here is the caller graph for this function:

boost::optional< Answer > iroha::consensus::yac::YacVoteStorage::store ( std::vector< VoteMessage state,
PeersNumberType  peers_in_round 
)

Insert votes in storage

Parameters
state- current message with votes
peers_in_round- number of peers participated in round
Returns
structure with result of inserting. boost::none if msg not valid.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: