use displaydoc::Display;
use massa_execution_exports::ExecutionError;
use massa_models::error::ModelsError;
use massa_protocol_exports::ProtocolError;
use massa_time::TimeError;
use std::array::TryFromSliceError;
use thiserror::Error;
#[non_exhaustive]
#[derive(Display, Error, Debug)]
pub enum ConsensusError {
ExecutionError(#[from] ExecutionError),
ModelsError(#[from] ModelsError),
SerializationError(String),
GenesisCreationError(String),
MissingBlock(String),
MissingOperation(String),
ContainerInconsistency(String),
FitnessOverflow,
InvalidLedgerChange(String),
IOError(#[from] std::io::Error),
SerdeError(#[from] serde_json::Error),
PosCycleUnavailable(String),
LedgerError(#[from] LedgerError),
MassaTimeError(#[from] TimeError),
TransactionError(String),
ProtocolError(#[from] ProtocolError),
InvalidTransition(String),
}
#[non_exhaustive]
#[derive(Display, Error, Debug)]
pub enum InternalError {
TransactionError(String),
}
#[non_exhaustive]
#[derive(Display, Error, Debug)]
pub enum LedgerError {
AmountOverflowError,
LedgerInconsistency(String),
ModelsError(#[from] ModelsError),
TryFromSliceError(#[from] TryFromSliceError),
IOError(#[from] std::io::Error),
SerdeError(#[from] serde_json::Error),
}