pub mod block; pub mod genesis; pub mod hardforks; pub mod miner_tx; #[cfg(feature = "rpc")] pub mod rpc; #[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, } #[derive(Debug)] pub enum DatabaseResponse { BlockHfInfo(hardforks::BlockHFInfo), BlockPOWInfo(block::pow::BlockPOWInfo), BlockWeights(block::weight::BlockWeightInfo), BlockHfInfoInRange(Vec), BlockWeightsInRange(Vec), BlockPOWInfoInRange(Vec), ChainHeight(u64), }