hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
supermajority_checker.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CONSENSUS_SUPERMAJORITY_CHECKER_HPP
7 #define IROHA_CONSENSUS_SUPERMAJORITY_CHECKER_HPP
8 
9 #include <memory>
10 #include <vector>
11 
15 
16 namespace shared_model {
17  namespace interface {
18  class Peer;
19  }
20 } // namespace shared_model
21 
22 namespace iroha {
23 
24  namespace consensus {
25  namespace yac {
26 
31  public:
32  virtual ~SupermajorityChecker() = default;
33 
40  virtual bool hasSupermajority(
42  &signatures,
43  const std::vector<std::shared_ptr<shared_model::interface::Peer>>
44  &peers) const = 0;
45 
52  virtual bool checkSize(PeersNumberType current,
53  PeersNumberType all) const = 0;
54 
61  virtual bool peersSubset(
63  &signatures,
64  const std::vector<std::shared_ptr<shared_model::interface::Peer>>
65  &peers) const = 0;
66 
76  virtual bool hasReject(PeersNumberType frequent,
77  PeersNumberType voted,
78  PeersNumberType all) const = 0;
79  };
80 
81  } // namespace yac
82  } // namespace consensus
83 } // namespace iroha
84 
85 #endif // IROHA_CONSENSUS_SUPERMAJORITY_CHECKER_HPP
boost::any_range< interface::Signature, boost::forward_traversal_tag, const Signature & > SignatureRangeType
Type of signature range, which returns when signatures are invoked.
Definition: range_types.hpp:24
Definition: block_query.hpp:16
size_t PeersNumberType
Type for number of peers in round.
Definition: yac_types.hpp:16
Definition: command_executor.hpp:12
Definition: supermajority_checker.hpp:30