6 #ifndef KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_VOTE_GRAPH_IMPL_HPP 7 #define KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_VOTE_GRAPH_IMPL_HPP 12 #include <unordered_map> 13 #include <unordered_set> 20 std::shared_ptr<VoterSet> voter_set,
21 std::shared_ptr<Chain> chain);
28 void adjustBase(
const std::vector<BlockHash> &ancestry_proof)
override;
33 const Id &voter)
override;
36 void remove(
VoteType vote_type,
const Id &voter)
override;
43 const Condition &condition)
const override;
60 const std::optional<BlockInfo> ¤t_best,
61 const Condition &condition)
const override;
71 void introduceBranch(
const std::vector<primitives::BlockHash> &descendants,
84 const Entry &active_node,
85 const std::optional<BlockInfo> &force_constrain,
120 #endif // KAGOME_CORE_CONSENSUS_GRANDPA_VOTE_GRAPH_VOTE_GRAPH_IMPL_HPP
const auto & getEntries() const
std::unordered_map< BlockHash, Entry > entries_
void adjustBase(const std::vector< BlockHash > &ancestry_proof) override
outcome::result< void > append(const BlockInfo &block)
std::unordered_set< BlockHash > heads_
std::shared_ptr< VoterSet > voter_set_
outcome::result< void > insert(VoteType vote_type, const BlockInfo &block, const Id &voter) override
Insert vote {.
std::optional< BlockInfo > findGhost(VoteType vote_type, const std::optional< BlockInfo > ¤t_best, const Condition &condition) const override
std::shared_ptr< Chain > chain_
crypto::Ed25519PublicKey Id
Subchain ghostFindMergePoint(VoteType vote_type, const BlockHash &active_node_hash, const Entry &active_node, const std::optional< BlockInfo > &force_constrain, const Condition &condition) const
std::function< bool(const VoteWeight &)> Condition
void introduceBranch(const std::vector< primitives::BlockHash > &descendants, const BlockInfo &ancestor)
std::shared_ptr< soralog::Logger > Logger
const auto & getHeads() const
const BlockInfo & getBase() const override
std::optional< BlockInfo > findAncestor(VoteType vote_type, const BlockInfo &block, const Condition &condition) const override
VoteGraphImpl(const BlockInfo &base, std::shared_ptr< VoterSet > voter_set, std::shared_ptr< Chain > chain)
std::optional< std::vector< primitives::BlockHash > > findContainingNodes(const BlockInfo &block) const