essential_node_types/
block.rs

1//! The `Block` type and related implementations.
2
3use core::time::Duration;
4use essential_types::{SolutionSet, Word};
5use serde::{Deserialize, Serialize};
6
7pub mod addr;
8#[cfg(test)]
9mod tests;
10
11/// An essential block.
12#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
13pub struct Block {
14    /// Metadata for the block.
15    #[serde(flatten)]
16    pub header: Header,
17    /// The list of solution sets that make up a block.
18    pub solution_sets: Vec<SolutionSet>,
19}
20
21/// The block header, containing metadata about the block.
22#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
23pub struct Header {
24    /// The block number.
25    pub number: Word,
26    /// The timestamp at which the
27    pub timestamp: Duration,
28}