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

#include "yac_block_storage.hpp"

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

Public Member Functions

 YacBlockStorage (YacHash hash, PeersNumberType peers_in_round, std::shared_ptr< SupermajorityChecker > supermajority_checker=std::make_shared< SupermajorityCheckerImpl >())
 
boost::optional< Answerinsert (VoteMessage msg)
 
boost::optional< Answerinsert (std::vector< VoteMessage > votes)
 
std::vector< VoteMessagegetVotes () const
 
size_t getNumberOfVotes () const
 
boost::optional< AnswergetState ()
 
bool isContains (const VoteMessage &msg) const
 
YacHash getStorageKey () const
 

Detailed Description

Class provide storage of votes for one block.

Constructor & Destructor Documentation

iroha::consensus::yac::YacBlockStorage::YacBlockStorage ( YacHash  hash,
PeersNumberType  peers_in_round,
std::shared_ptr< SupermajorityChecker supermajority_checker = std::make_shared<SupermajorityCheckerImpl>() 
)

Here is the call graph for this function:

Member Function Documentation

size_t iroha::consensus::yac::YacBlockStorage::getNumberOfVotes ( ) const
Returns
number of votes attached to storage
boost::optional< Answer > iroha::consensus::yac::YacBlockStorage::getState ( )
Returns
current block store state

Here is the caller graph for this function:

YacHash iroha::consensus::yac::YacBlockStorage::getStorageKey ( ) const

Provide key attached to this storage

std::vector< VoteMessage > iroha::consensus::yac::YacBlockStorage::getVotes ( ) const
Returns
votes attached to storage
boost::optional< Answer > iroha::consensus::yac::YacBlockStorage::insert ( VoteMessage  msg)

Try to insert vote to storage

Parameters
msg- vote for insertion
Returns
actual state of storage, boost::none when storage doesn't have supermajority

Here is the call graph for this function:

Here is the caller graph for this function:

boost::optional< Answer > iroha::consensus::yac::YacBlockStorage::insert ( std::vector< VoteMessage votes)

Insert vector of votes to current storage

Parameters
votes- bunch of votes for insertion
Returns
state of storage after insertion last vote, boost::none when storage doesn't have supermajority

Here is the call graph for this function:

bool iroha::consensus::yac::YacBlockStorage::isContains ( const VoteMessage msg) const

Verify that passed vote contains in storage

Parameters
msg- vote for finding
Returns
true, if contains

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