Derive thiserror::Error for ProofError
This commit is contained in:
parent
2c51288afd
commit
88ce934bd7
|
@ -1,19 +1,20 @@
|
|||
//! Errors related to proving and verifying proofs.
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Error, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum ProofError {
|
||||
/// This error occurs when a proof failed to verify.
|
||||
#[error("proof failed to verify")]
|
||||
VerificationError,
|
||||
/// This error occurs when the proof encoding is malformed.
|
||||
#[error("malformed proof")]
|
||||
FormatError,
|
||||
/// This error occurs during proving if the number of blinding
|
||||
/// factors does not match the number of values.
|
||||
#[error("number of blinding factors do not match the number of values")]
|
||||
WrongNumBlindingFactors,
|
||||
/// This error occurs when attempting to create a proof with
|
||||
/// bitsize other than \\(8\\), \\(16\\), \\(32\\), or \\(64\\).
|
||||
#[error("attempted to create a proof with bitsize other than \\(8\\), \\(16\\), \\(32\\), or \\(64\\)")]
|
||||
InvalidBitsize,
|
||||
/// This error occurs when there are insufficient generators for the proof.
|
||||
#[error("insufficient generators for the proof")]
|
||||
InvalidGeneratorsLength,
|
||||
/// This error occurs a `zk_token_elgamal::pod::ElGamalCiphertext` contains invalid ElGamalCiphertext ciphertext
|
||||
#[error(
|
||||
"`zk_token_elgamal::pod::ElGamalCiphertext` contains invalid ElGamalCiphertext ciphertext"
|
||||
)]
|
||||
InconsistentCTData,
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ pub trait Verifiable {
|
|||
}
|
||||
|
||||
#[cfg(not(target_arch = "bpf"))]
|
||||
#[derive(Debug,Copy,Clone)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum Role {
|
||||
Source,
|
||||
Dest,
|
||||
|
|
Loading…
Reference in New Issue