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 Member Functions

virtual ~SupermajorityChecker ()=default
 
virtual bool hasSupermajority (const shared_model::interface::types::SignatureRangeType &signatures, const std::vector< std::shared_ptr< shared_model::interface::Peer >> &peers) const =0
 
virtual bool checkSize (PeersNumberType current, PeersNumberType all) const =0
 
virtual bool peersSubset (const shared_model::interface::types::SignatureRangeType &signatures, const std::vector< std::shared_ptr< shared_model::interface::Peer >> &peers) const =0
 
virtual bool hasReject (PeersNumberType frequent, PeersNumberType voted, PeersNumberType all) const =0
 

Detailed Description

Interface is responsible for checking if supermajority is achieved

Constructor & Destructor Documentation

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

Member Function Documentation

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

Check if supermajority is possible

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

Implemented in iroha::consensus::yac::SupermajorityCheckerImpl.

virtual bool iroha::consensus::yac::SupermajorityChecker::hasReject ( PeersNumberType  frequent,
PeersNumberType  voted,
PeersNumberType  all 
) const
pure virtual

Check if there is available reject proof. Reject proof is proof that in current round no one hash doesn't achieve supermajority.

Parameters
frequent- number of times, that appears most frequent element
voted- all number of voted peers
all- number of peers in round
Returns
true, if reject

Implemented in iroha::consensus::yac::SupermajorityCheckerImpl.

virtual bool iroha::consensus::yac::SupermajorityChecker::hasSupermajority ( const shared_model::interface::types::SignatureRangeType signatures,
const std::vector< std::shared_ptr< shared_model::interface::Peer >> &  peers 
) const
pure virtual

Check if supermajority is achieved

Parameters
signaturesset of signatures to check
peersset of peers with signatures
Returns
true on supermajority is achieved or false otherwise

Implemented in iroha::consensus::yac::SupermajorityCheckerImpl.

virtual bool iroha::consensus::yac::SupermajorityChecker::peersSubset ( const shared_model::interface::types::SignatureRangeType signatures,
const std::vector< std::shared_ptr< shared_model::interface::Peer >> &  peers 
) const
pure virtual

Checks if signatures is a subset of signatures of peers

Parameters
signaturesto check
peerswith signatures
Returns
true if is subset or false otherwise

Implemented in iroha::consensus::yac::SupermajorityCheckerImpl.


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