mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-12 17:11:27 +01:00
use thiserror (#135)
This commit is contained in:
@@ -32,6 +32,7 @@ bincode = "1.2.1"
|
|||||||
flate2 = "1.0"
|
flate2 = "1.0"
|
||||||
bitvec = "1.0"
|
bitvec = "1.0"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
|
thiserror = "1.0"
|
||||||
|
|
||||||
[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
|
[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
|
||||||
pasta-msm = { version = "0.1.0", package = "lurk-pasta-msm" }
|
pasta-msm = { version = "0.1.0", package = "lurk-pasta-msm" }
|
||||||
|
|||||||
@@ -1,31 +1,44 @@
|
|||||||
//! This module defines errors returned by the library.
|
//! This module defines errors returned by the library.
|
||||||
use core::fmt::Debug;
|
use core::fmt::Debug;
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
/// Errors returned by Nova
|
/// Errors returned by Nova
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, Error)]
|
||||||
pub enum NovaError {
|
pub enum NovaError {
|
||||||
/// returned if the supplied row or col in (row,col,val) tuple is out of range
|
/// returned if the supplied row or col in (row,col,val) tuple is out of range
|
||||||
|
#[error("InvalidIndex")]
|
||||||
InvalidIndex,
|
InvalidIndex,
|
||||||
/// returned if the supplied input is not even-sized
|
/// returned if the supplied input is not even-sized
|
||||||
|
#[error("OddInputLength")]
|
||||||
OddInputLength,
|
OddInputLength,
|
||||||
/// returned if the supplied input is not of the right length
|
/// returned if the supplied input is not of the right length
|
||||||
|
#[error("InvalidInputLength")]
|
||||||
InvalidInputLength,
|
InvalidInputLength,
|
||||||
/// returned if the supplied witness is not of the right length
|
/// returned if the supplied witness is not of the right length
|
||||||
|
#[error("InvalidWitnessLength")]
|
||||||
InvalidWitnessLength,
|
InvalidWitnessLength,
|
||||||
/// returned if the supplied witness is not a satisfying witness to a given shape and instance
|
/// returned if the supplied witness is not a satisfying witness to a given shape and instance
|
||||||
|
#[error("UnSat")]
|
||||||
UnSat,
|
UnSat,
|
||||||
/// returned when the supplied compressed commitment cannot be decompressed
|
/// returned when the supplied compressed commitment cannot be decompressed
|
||||||
|
#[error("DecompressionError")]
|
||||||
DecompressionError,
|
DecompressionError,
|
||||||
/// returned if proof verification fails
|
/// returned if proof verification fails
|
||||||
|
#[error("ProofVerifyError")]
|
||||||
ProofVerifyError,
|
ProofVerifyError,
|
||||||
/// returned if the provided number of steps is zero
|
/// returned if the provided number of steps is zero
|
||||||
|
#[error("InvalidNumSteps")]
|
||||||
InvalidNumSteps,
|
InvalidNumSteps,
|
||||||
/// returned when an invalid inner product argument is provided
|
/// returned when an invalid inner product argument is provided
|
||||||
|
#[error("InvalidIPA")]
|
||||||
InvalidIPA,
|
InvalidIPA,
|
||||||
/// returned when an invalid sum-check proof is provided
|
/// returned when an invalid sum-check proof is provided
|
||||||
|
#[error("InvalidSumcheckProof")]
|
||||||
InvalidSumcheckProof,
|
InvalidSumcheckProof,
|
||||||
/// returned when the initial input to an incremental computation differs from a previously declared arity
|
/// returned when the initial input to an incremental computation differs from a previously declared arity
|
||||||
|
#[error("InvalidInitialInputLength")]
|
||||||
InvalidInitialInputLength,
|
InvalidInitialInputLength,
|
||||||
/// returned when the step execution produces an output whose length differs from a previously declared arity
|
/// returned when the step execution produces an output whose length differs from a previously declared arity
|
||||||
|
#[error("InvalidStepOutputLength")]
|
||||||
InvalidStepOutputLength,
|
InvalidStepOutputLength,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user