use crate::utils::VecDisplayWrapper;
#[derive(strum_macros::Display, Debug, PartialEq, Clone)]
pub enum DecodingError {
#[strum(to_string = "Mismatched disclosure format")]
MismatchedDisclosureFormat,
#[strum(to_string = "Reserved key name {0} usage")]
ReservedKeyName(&'static str),
#[strum(to_string = "Malformed digest: {0}")]
MalformedDigest(String),
#[strum(to_string = "Disclosure digest collision")]
DisclosureDigestCollision,
#[strum(to_string = "Duplicated digest: {0}")]
DuplicateDigest(String),
#[strum(to_string = "Unused disclosures: {0}")]
UnusedDisclosures(VecDisplayWrapper<String>),
#[strum(to_string = "Duplicate claim name: {0}")]
DuplicateClaimName(String),
#[strum(to_string = "Invalid hash algorithm name: {0}")]
InvalidHashAlgorithmName(String),
#[strum(to_string = "Missing hasher: {0}")]
MissingHasher(String),
}
impl bherror::BhError for DecodingError {}
pub type DecodingResult<T> = bherror::Result<T, DecodingError>;