massa_pos_exports/error.rs
1use displaydoc::Display;
2use thiserror::Error;
3
4/// Proof-of-Stake result
5pub type PosResult<T, E = PosError> = core::result::Result<T, E>;
6
7/// Proof-of-Stake error
8#[non_exhaustive]
9#[derive(Display, Error, Debug, Clone)]
10pub enum PosError {
11 /// Container inconsistency: {0}
12 ContainerInconsistency(String),
13 /// Invalid roll distribution: {0}
14 InvalidRollDistribution(String),
15 /// Overflow error: {0}
16 OverflowError(String),
17 /// `CycleUnavailable`: PoS cycle {0} is needed but is absent from cache
18 CycleUnavailable(u64),
19 /// `CycleUnfinished`: PoS cycle {0} is needed but is not complete yet
20 CycleUnfinished(u64),
21 /// Error while loading initial rolls file: {0}
22 RollsFileLoadingError(String),
23 /// Error while loading initial deferred credits file: {0}
24 DeferredCreditsFileLoadingError(String),
25 /// Communication channel was down: {0}
26 ChannelDown(String),
27}