Skip to main content

forest/blocks/
mod.rs

1// Copyright 2019-2026 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use thiserror::Error;
5
6mod block;
7#[cfg(test)]
8mod chain4u;
9mod election_proof;
10mod gossip_block;
11mod header;
12mod ticket;
13#[cfg(not(doc))]
14mod tipset;
15#[cfg(doc)]
16pub mod tipset;
17mod vrf_proof;
18
19pub use block::{BLOCK_MESSAGE_LIMIT, Block, TxMeta};
20pub use election_proof::ElectionProof;
21pub use gossip_block::GossipBlock;
22pub use header::{CachingBlockHeader, RawBlockHeader};
23pub use ticket::Ticket;
24pub use tipset::{CreateTipsetError, FullTipset, Tipset, TipsetKey};
25pub use vrf_proof::VRFProof;
26
27/// Blockchain blocks error
28#[derive(Debug, PartialEq, Eq, Error)]
29pub enum Error {
30    /// Invalid signature
31    #[error("Invalid signature: {0}")]
32    InvalidSignature(String),
33    /// Error in validating arbitrary data
34    #[error("Error validating data: {0}")]
35    Validation(String),
36}
37
38#[cfg(test)]
39pub(crate) use chain4u::{Chain4U, HeaderBuilder, chain4u};
40
41#[cfg(any(test, doc))]
42mod tests {
43
44    mod serialization_vectors;
45    mod ticket_test;
46}