Kagome
Polkadot Runtime Engine in C++17
|
#include <vote_tracker.hpp>
Public Types | |
enum | PushResult { PushResult::SUCCESS, PushResult::DUPLICATED, PushResult::EQUIVOCATED } |
Public Member Functions | |
virtual | ~VoteTracker ()=default |
virtual PushResult | push (const SignedMessage &vote, size_t weight)=0 |
virtual void | unpush (const SignedMessage &vote, size_t weight)=0 |
virtual std::vector< VoteVariant > | getMessages () const =0 |
virtual size_t | getTotalWeight () const =0 |
Stores voting messages (such as prevotes and precommits) during a round, reports if a messages that is being put into it is a duplicate or an equivote (which is the case when a node votes for two different blocks during a round)
Definition at line 19 of file vote_tracker.hpp.
Enumerator | |
---|---|
SUCCESS | |
DUPLICATED | |
EQUIVOCATED |
Definition at line 21 of file vote_tracker.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in kagome::consensus::grandpa::VoteTrackerImpl.
|
pure virtual |
Implemented in kagome::consensus::grandpa::VoteTrackerImpl.
|
pure virtual |
Attempts to push a vote to a tracker
vote | the voting message being pushed |
weight | weight of this vote |
Implemented in kagome::consensus::grandpa::VoteTrackerImpl.
|
pure virtual |
Unpush a vote from a tracker (i.e. at wrong vote)
vote | the voting message was pushed before |
weight | weight of this vote |
Implemented in kagome::consensus::grandpa::VoteTrackerImpl.