use thiserror::Error;
use xor_name::XorName;
pub(crate) type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("Failed to build the payment proof tree: {0}")]
ProofTree(String),
#[error("Failed to generate the audit trail for leaf item #{index}: {reason}")]
GenAuditTrail { index: usize, reason: String },
#[error("Failed to build an audit trail from the provided information: {0}")]
InvalidAuditTrail(String),
#[error("The given payment proof audit trail failed to self-validate: {0}")]
AuditTrailSelfValidation(String),
#[error("The leaf data for which proof was generated doesn't match the given item: {0:?}")]
AuditTrailItemMismatch(XorName),
#[error("The root data of the proof doesn't match the given reason hash: {0}")]
ReasonHashMismatch(String),
}