#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HashTreeError {
InvalidHashTree,
UnsupportedHashVersion,
CorruptedHashTree,
BlockOutOfRange,
BufferTooSmall,
EntryNotFound,
}
impl core::fmt::Display for HashTreeError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
HashTreeError::InvalidHashTree => write!(f, "Invalid hash tree format"),
HashTreeError::UnsupportedHashVersion => write!(f, "Unsupported hash version"),
HashTreeError::CorruptedHashTree => write!(f, "Corrupted hash tree"),
HashTreeError::BlockOutOfRange => write!(f, "Block number out of range"),
HashTreeError::BufferTooSmall => write!(f, "Buffer too small"),
HashTreeError::EntryNotFound => write!(f, "Entry not found"),
}
}
}