use thiserror::Error;
#[derive(Error, Copy, Clone, Debug, PartialEq, Eq)]
pub enum RandError {
#[error("failed to generate a secure stream of random bytes")]
FillBytes,
}
#[derive(Error, Copy, Clone, Debug, PartialEq, Eq)]
pub enum NoteError {
#[error("Randomness generation failure")]
InsufficientRandomness(#[from] RandError),
#[error("failed to generate an Orchard note's rho.")]
InvalidRho,
}
#[derive(Error, Copy, Clone, Debug, PartialEq, Eq)]
pub enum NoteCommitmentError {
#[error("Randomness generation failure")]
InsufficientRandomness(#[from] RandError),
#[error("failed to generate a sapling::NoteCommitment from a diversifier")]
InvalidDiversifier,
}
#[derive(Error, Copy, Clone, Debug, PartialEq, Eq)]
pub enum KeyError {
#[error("Randomness generation failure")]
InsufficientRandomness(#[from] RandError),
}
#[derive(Error, Copy, Clone, Debug, PartialEq, Eq)]
pub enum AddressError {
#[error("Randomness generation failure")]
InsufficientRandomness(#[from] RandError),
#[error("Randomness did not hash into the Jubjub group for producing a new diversifier")]
DiversifierGenerationFailure,
}