1use alloy_primitives::{Address, B256};
2use reth_consensus::ConsensusError;
3
4#[derive(Debug, thiserror::Error)]
6pub enum TempoConsensusError {
7 #[error("timestamp milliseconds part {millis_part} must be less than 1000")]
9 InvalidTimestampMillisPart { millis_part: u64 },
10
11 #[error("shared gas limit {actual} does not match expected {expected}")]
13 SharedGasLimitMismatch { expected: u64, actual: u64 },
14
15 #[error("general gas limit {actual} does not match expected {expected}")]
17 GeneralGasLimitMismatch { expected: u64, actual: u64 },
18
19 #[error("invalid system transaction: {tx_hash}")]
21 InvalidSystemTransaction { tx_hash: B256 },
22
23 #[error("block must contain {expected} end-of-block system txs, found {actual}")]
25 MissingEndOfBlockSystemTxs { expected: usize, actual: usize },
26
27 #[error("invalid end-of-block system tx order: expected {expected}, got {actual}")]
29 InvalidEndOfBlockSystemTxOrder { expected: Address, actual: Address },
30}
31
32impl From<TempoConsensusError> for ConsensusError {
33 fn from(err: TempoConsensusError) -> Self {
34 Self::other(err)
35 }
36}