battleware_types/
lib.rs

1pub mod api;
2pub use api::Query;
3pub mod execution;
4use commonware_cryptography::{
5    sha256::{Digest, Sha256},
6    Digestible, Hasher,
7};
8pub use execution::{
9    leader_index, Activity, Block, Evaluation, Finalization, Finalized, Identity, Notarization,
10    Notarized, Seed, Signature, NAMESPACE,
11};
12
13/// Genesis message to use during initialization.
14const GENESIS: &[u8] = b"commonware is neat";
15
16/// Get the genesis block.
17pub fn genesis_block() -> Block {
18    let genesis_parent = Sha256::hash(GENESIS);
19    Block::new(genesis_parent, 0, 0, vec![])
20}
21
22/// Compute the digest of the genesis block.
23pub fn genesis_digest() -> Digest {
24    genesis_block().digest()
25}