Kagome
Polkadot Runtime Engine in C++17
prepare_transcript.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CONSENSUS_PREPARETRANSACRIPT
7 #define KAGOME_CONSENSUS_PREPARETRANSACRIPT
8 
11 
12 namespace kagome::consensus {
13 
15  primitives::Transcript &transcript,
16  const Randomness &randomness,
17  BabeSlotNumber slot_number,
18  EpochNumber epoch) {
19  transcript.initialize({'B', 'A', 'B', 'E'});
20  transcript.append_message(
21  {'s', 'l', 'o', 't', ' ', 'n', 'u', 'm', 'b', 'e', 'r'}, slot_number);
22  transcript.append_message(
23  {'c', 'u', 'r', 'r', 'e', 'n', 't', ' ', 'e', 'p', 'o', 'c', 'h'},
24  epoch);
25  transcript.append_message({'c',
26  'h',
27  'a',
28  'i',
29  'n',
30  ' ',
31  'r',
32  'a',
33  'n',
34  'd',
35  'o',
36  'm',
37  'n',
38  'e',
39  's',
40  's'},
41  randomness.internal_array_reference());
42  return transcript;
43  }
44 
45 } // namespace kagome::consensus
46 
47 #endif // KAGOME_CONSENSUS_PREPARETRANSACRIPT
const_narref internal_array_reference() const
Definition: blob.hpp:129
void initialize(const T(&label)[N])
Definition: transcript.hpp:45
void append_message(const T(&label)[N], const K(&msg)[M])
Definition: transcript.hpp:52
uint64_t BabeSlotNumber
slot number of the Babe production
Definition: common.hpp:24
uint64_t EpochNumber
number of the epoch in the Babe production
Definition: common.hpp:27
primitives::Transcript & prepareTranscript(primitives::Transcript &transcript, const Randomness &randomness, BabeSlotNumber slot_number, EpochNumber epoch)