Kagome
Polkadot Runtime Engine in C++17
kagome::consensus::grandpa::VoteWeight Class Reference

#include <vote_weight.hpp>

Inheritance diagram for kagome::consensus::grandpa::VoteWeight:
Collaboration diagram for kagome::consensus::grandpa::VoteWeight:

Classes

struct  OneTypeVoteWeight
 

Public Types

using Weight = size_t
 

Public Member Functions

Weight sum (VoteType vote_type) const
 
void set (VoteType vote_type, size_t index, size_t weight)
 
void unset (VoteType vote_type, size_t index, size_t weight)
 
Weight total (VoteType vote_type, const std::vector< bool > &equivocators, const VoterSet &voter_set) const
 
void merge (const VoteWeight &other, const std::shared_ptr< VoterSet > &voter_set)
 
bool operator== (const VoteWeight &other) const
 

Private Attributes

OneTypeVoteWeight prevotes_weight
 
OneTypeVoteWeight precommits_weight
 

Detailed Description

Vote weight is a structure that keeps track of who voted for the vote and with which weight

Definition at line 23 of file vote_weight.hpp.

Member Typedef Documentation

Definition at line 26 of file vote_weight.hpp.

Member Function Documentation

void kagome::consensus::grandpa::VoteWeight::merge ( const VoteWeight other,
const std::shared_ptr< VoterSet > &  voter_set 
)
inline

Definition at line 127 of file vote_weight.hpp.

bool kagome::consensus::grandpa::VoteWeight::operator== ( const VoteWeight other) const
inline

Definition at line 133 of file vote_weight.hpp.

void kagome::consensus::grandpa::VoteWeight::set ( VoteType  vote_type,
size_t  index,
size_t  weight 
)
inline

Definition at line 95 of file vote_weight.hpp.

Weight kagome::consensus::grandpa::VoteWeight::sum ( VoteType  vote_type) const
inline

Definition at line 85 of file vote_weight.hpp.

Weight kagome::consensus::grandpa::VoteWeight::total ( VoteType  vote_type,
const std::vector< bool > &  equivocators,
const VoterSet voter_set 
) const
inline

Definition at line 115 of file vote_weight.hpp.

void kagome::consensus::grandpa::VoteWeight::unset ( VoteType  vote_type,
size_t  index,
size_t  weight 
)
inline

Definition at line 105 of file vote_weight.hpp.

Member Data Documentation

OneTypeVoteWeight kagome::consensus::grandpa::VoteWeight::precommits_weight
private

Definition at line 140 of file vote_weight.hpp.

OneTypeVoteWeight kagome::consensus::grandpa::VoteWeight::prevotes_weight
private

Definition at line 139 of file vote_weight.hpp.


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