pub type SynthesisResult<T> = Result<T, SynthesisError>;
#[derive(Debug, Error)]
pub enum SynthesisError {
#[error("{}", _0)]
AnyhowError(#[from] anyhow::Error),
#[error("An assignment for a variable could not be computed")]
AssignmentMissing,
#[error("Failed to convert object into constraint field elements")]
ConstraintFieldError(#[from] snarkvm_fields::ConstraintFieldError),
#[error("Division by zero during synthesis")]
DivisionByZero,
#[error("Unsatisfiable constraint system")]
Unsatisfiable,
#[error("Polynomial degree is too large")]
PolyTooLarge,
#[error("Encountered an identity element in the CRS")]
UnexpectedIdentity,
#[error("Encountered an I/O error")]
IoError(std::io::Error),
#[error("Malformed verifying key, public input count was {} but expected {}", _0, _1)]
MalformedVerifyingKey(usize, usize),
#[error("Auxiliary variable was unconstrained")]
UnconstrainedVariable,
}
impl From<std::io::Error> for SynthesisError {
fn from(e: std::io::Error) -> SynthesisError {
SynthesisError::IoError(e)
}
}