Kagome
Polkadot Runtime Engine in C++17
babe_lottery.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_BABE_LOTTERY_HPP
7 #define KAGOME_BABE_LOTTERY_HPP
8 
9 #include <optional>
10 
12 #include "crypto/sr25519_types.hpp"
14 
15 namespace kagome::consensus {
30  struct BabeLottery {
31  virtual ~BabeLottery() = default;
32 
40  virtual void changeEpoch(const EpochDescriptor &epoch,
41  const Randomness &randomness,
42  const Threshold &threshold,
43  const crypto::Sr25519Keypair &keypair) = 0;
44 
48  virtual EpochDescriptor getEpoch() const = 0;
49 
56  virtual std::optional<crypto::VRFOutput> getSlotLeadership(
57  primitives::BabeSlotNumber slot) const = 0;
58 
66  primitives::BabeSlotNumber slot) const = 0;
67 
76  virtual std::optional<primitives::AuthorityIndex> secondarySlotAuthor(
78  primitives::AuthorityListSize authorities_count,
79  const Randomness &randomness) const = 0;
80  };
81 } // namespace kagome::consensus
82 
83 #endif // KAGOME_BABE_LOTTERY_HPP
virtual ~BabeLottery()=default
virtual void changeEpoch(const EpochDescriptor &epoch, const Randomness &randomness, const Threshold &threshold, const crypto::Sr25519Keypair &keypair)=0
virtual std::optional< crypto::VRFOutput > getSlotLeadership(primitives::BabeSlotNumber slot) const =0
virtual std::optional< primitives::AuthorityIndex > secondarySlotAuthor(primitives::BabeSlotNumber slot, primitives::AuthorityListSize authorities_count, const Randomness &randomness) const =0
virtual EpochDescriptor getEpoch() const =0
virtual crypto::VRFOutput slotVrfSignature(primitives::BabeSlotNumber slot) const =0
uint64_t AuthorityListSize
Definition: authority.hpp:21
crypto::VRFThreshold Threshold
threshold, which must not be exceeded for the party to be a slot leader
Definition: common.hpp:33