#[doc(hidden)]
pub const STR_002_MODULE_PRESENT: () = ();
use crate::types::epoch_phase::EpochPhase;
#[derive(Debug, Clone, thiserror::Error)]
pub enum CheckpointCompetitionError {
#[error("Invalid checkpoint data: {0}")]
InvalidData(String),
#[error("Checkpoint competition not found for epoch {0}")]
NotFound(u64),
#[error("Score not higher: current {current}, submitted {submitted}")]
ScoreNotHigher {
current: u64,
submitted: u64,
},
#[error("Epoch mismatch: expected {expected}, got {got}")]
EpochMismatch {
expected: u64,
got: u64,
},
#[error("Competition already finalized")]
AlreadyFinalized,
#[error("Competition not started")]
NotStarted,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum EpochError {
#[error("Cannot advance: epoch {0} is not complete")]
EpochNotComplete(u64),
#[error("Cannot advance: epoch {0} has no finalized checkpoint")]
NoFinalizedCheckpoint(u64),
#[error("Checkpoint block at height {0} is not empty: {1} bundles, {2} cost, {3} fees")]
CheckpointBlockNotEmpty(u64, u32, u64, u64),
#[error("Phase mismatch: expected {expected}, got {got}")]
PhaseMismatch {
expected: EpochPhase,
got: EpochPhase,
},
#[error("Epoch mismatch: expected {expected}, got {got}")]
EpochMismatch {
expected: u64,
got: u64,
},
#[error("Invalid height {0}: below genesis")]
InvalidHeight(u64),
#[error("DFSP not active at height {0}")]
DfspNotActive(u64),
#[error("DFSP epoch-boundary error: {0}")]
DfspBoundary(String),
#[error("Competition error: {0}")]
Competition(#[from] CheckpointCompetitionError),
#[error("Invalid data: {0}")]
InvalidData(String),
}