6 #ifndef KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_HPP 7 #define KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_HPP 9 #include <boost/operators.hpp> 23 struct Entry :
public boost::equality_comparable<Entry> {
46 const auto offset =
number - n - 1u;
61 using Condition = std::function<bool(const VoteWeight &)>;
63 std::function<bool(const VoteWeight &, const VoteWeight &)>;
72 virtual void adjustBase(
const std::vector<BlockHash> &ancestry_proof) = 0;
80 virtual void remove(
VoteType vote_type,
const Id &voter) = 0;
102 virtual std::optional<BlockInfo>
findGhost(
104 const std::optional<BlockInfo> ¤t_best,
110 #endif // KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_HPP
virtual ~VoteGraph()=default
VoteWeight cumulative_vote
std::vector< BlockHash > hashes
virtual const BlockInfo & getBase() const =0
crypto::Ed25519PublicKey Id
virtual std::optional< BlockInfo > findAncestor(VoteType vote_type, const BlockInfo &block, const Condition &condition) const =0
std::optional< BlockHash > getAncestorBlockBy(BlockNumber n) const
std::function< bool(const VoteWeight &)> Condition
virtual void adjustBase(const std::vector< BlockHash > &ancestry_proof)=0
bool operator==(const Entry &o) const
primitives::BlockNumber BlockNumber
std::vector< BlockHash > descendants
std::vector< BlockHash > ancestors
virtual std::optional< BlockInfo > findGhost(VoteType vote_type, const std::optional< BlockInfo > ¤t_best, const Condition &condition) const =0
std::function< bool(const VoteWeight &, const VoteWeight &)> Comparator
virtual outcome::result< void > insert(VoteType vote_type, const BlockInfo &block, const Id &voter)=0
Insert vote {.