pub mod block; pub mod genesis; pub mod hardforks; pub mod miner_tx; #[cfg(feature = "binaries")] pub mod rpc; pub mod verifier; #[derive(Debug, thiserror::Error)] pub enum ConsensusError { #[error("Invalid hard fork version: {0}")] InvalidHardForkVersion(&'static str), #[error("Database error: {0}")] Database(#[from] tower::BoxError), } pub trait Database: tower::Service { } impl> Database for T { } #[derive(Debug, Clone)] pub enum DatabaseRequest { BlockHFInfo(cuprate_common::BlockID), BlockPOWInfo(cuprate_common::BlockID), BlockWeights(cuprate_common::BlockID), BlockHfInfoInRange(std::ops::Range), BlockWeightsInRange(std::ops::Range), BlockPOWInfoInRange(std::ops::Range), ChainHeight, #[cfg(feature = "binaries")] BlockBatchInRange(std::ops::Range), #[cfg(feature = "binaries")] Transactions(Vec<[u8; 32]>), } #[derive(Debug)] pub enum DatabaseResponse { BlockHFInfo(hardforks::BlockHFInfo), BlockPOWInfo(block::pow::BlockPOWInfo), BlockWeights(block::weight::BlockWeightInfo), BlockHfInfoInRange(Vec), BlockWeightsInRange(Vec), BlockPOWInfoInRange(Vec), ChainHeight(u64), #[cfg(feature = "binaries")] BlockBatchInRange(Vec), #[cfg(feature = "binaries")] Transactions(Vec), }