use thiserror::Error;
#[allow(missing_copy_implementations)]
#[derive(Error, Debug)]
pub enum EntryError {
#[error("backlink and skiplink not valid for this sequence number")]
InvalidLinks,
#[error(transparent)]
HashError(#[from] crate::hash::HashError),
#[error(transparent)]
SeqNumError(#[from] SeqNumError),
}
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum EntrySignedError {
#[error("invalid hex encoding in entry")]
InvalidHexEncoding,
#[error("operation needs to match payload hash of encoded entry")]
OperationHashMismatch,
#[error("entry does not contain any operation")]
OperationMissing,
#[error("entry requires skiplink for encoding")]
SkiplinkMissing,
#[error("backlink and skiplink are identical")]
BacklinkAndSkiplinkIdentical,
#[error(transparent)]
SeqNumError(#[from] SeqNumError),
#[error(transparent)]
HashError(#[from] crate::hash::HashError),
#[error(transparent)]
OperationEncodedError(#[from] crate::operation::OperationEncodedError),
#[error(transparent)]
BambooEncodeError(#[from] bamboo_rs_core_ed25519_yasmf::entry::encode::Error),
#[error(transparent)]
BambooDecodeError(#[from] bamboo_rs_core_ed25519_yasmf::entry::decode::Error),
#[error(transparent)]
Ed25519SignatureError(#[from] ed25519_dalek::SignatureError),
}
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum SeqNumError {
#[error("sequence number can not be zero or negative")]
NotZeroOrNegative,
#[error("string contains invalid u64 value")]
InvalidU64String,
}
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum LogIdError {
#[error("string contains invalid u64 value")]
InvalidU64String,
}