kaspa_consensus_core/errors/
difficulty.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, Clone)]
4pub enum DifficultyError {
5    #[error("under min allowed window size ({0} < {1})")]
6    UnderMinWindowSizeAllowed(usize, usize),
7
8    #[error("window data has only {0} entries -- this usually happens when the node has just began syncing")]
9    InsufficientWindowData(usize),
10
11    #[error("min window timestamp is equal to the max window timestamp")]
12    EmptyTimestampRange,
13}
14
15pub type DifficultyResult<T> = std::result::Result<T, DifficultyError>;