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

#include "supermajority_checker.hpp"

Inheritance diagram for iroha::consensus::yac::SupermajorityChecker:
Inheritance graph
Collaboration diagram for iroha::consensus::yac::SupermajorityChecker:
Collaboration graph

Public Types

using VoteGroups = boost::any_range< PeersNumberType, boost::forward_traversal_tag, const PeersNumberType, std::ptrdiff_t >
 

Public Member Functions

virtual ~SupermajorityChecker ()=default
 
virtual bool hasSupermajority (PeersNumberType current, PeersNumberType all) const =0
 
virtual bool canHaveSupermajority (const VoteGroups &votes, PeersNumberType all) const =0
 

Detailed Description

Interface is responsible for checking if supermajority is achieved

Member Typedef Documentation

using iroha::consensus::yac::SupermajorityChecker::VoteGroups = boost::any_range<PeersNumberType, boost::forward_traversal_tag, const PeersNumberType, std::ptrdiff_t>

Constructor & Destructor Documentation

virtual iroha::consensus::yac::SupermajorityChecker::~SupermajorityChecker ( )
virtualdefault

Member Function Documentation

virtual bool iroha::consensus::yac::SupermajorityChecker::canHaveSupermajority ( const VoteGroups votes,
PeersNumberType  all 
) const
pure virtual

Check if supermajority is possible

Parameters
voted- numbers of peers voted for each option
all- number of peers in round
Returns
true, if reject

Implemented in iroha::consensus::yac::SupermajorityCheckerBft, and iroha::consensus::yac::SupermajorityCheckerCft.

virtual bool iroha::consensus::yac::SupermajorityChecker::hasSupermajority ( PeersNumberType  current,
PeersNumberType  all 
) const
pure virtual

Check if supermajority is achieved

Parameters
currentactual number of signatures
allnumber of peers
Returns
true if supermajority is possible or false otherwise

Implemented in iroha::consensus::yac::SupermajorityCheckerBft, and iroha::consensus::yac::SupermajorityCheckerCft.


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