#include "supermajority_checker.hpp"


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 | isTolerated (PeersNumberType number, PeersNumberType all) const =0 |
| virtual bool | canHaveSupermajority (const VoteGroups &votes, PeersNumberType all) const =0 |
Interface is responsible for checking if supermajority is achieved
| using iroha::consensus::yac::SupermajorityChecker::VoteGroups = boost::any_range<PeersNumberType, boost::forward_traversal_tag, const PeersNumberType, std::ptrdiff_t> |
|
virtualdefault |
|
pure virtual |
Check if supermajority is possible
| voted | - numbers of peers voted for each option |
| all | - number of peers in round |
Implemented in iroha::consensus::yac::SupermajorityCheckerBft, and iroha::consensus::yac::SupermajorityCheckerCft.
|
pure virtual |
Check if supermajority is achieved
| current | actual number of signatures |
| all | number of peers |
Implemented in iroha::consensus::yac::SupermajorityCheckerBft, and iroha::consensus::yac::SupermajorityCheckerCft.
|
pure virtual |
Check tolerance condition
| number | - voted peers |
| all | - number of all peers in network |
Implemented in iroha::consensus::yac::SupermajorityCheckerBft, and iroha::consensus::yac::SupermajorityCheckerCft.