Move Error struct into a submodule

Just to make it easier to work on.
This commit is contained in:
Jack Grigg 2021-05-18 17:50:09 +01:00
parent a635b7c25a
commit de1a468691
2 changed files with 28 additions and 27 deletions

View File

@ -16,6 +16,7 @@ use crate::poly::{
use crate::transcript::{ChallengeScalar, EncodedChallenge, Transcript};
mod circuit;
mod error;
mod keygen;
mod lookup;
pub(crate) mod permutation;
@ -25,6 +26,7 @@ mod prover;
mod verifier;
pub use circuit::*;
pub use error::*;
pub use keygen::*;
pub use prover::*;
pub use verifier::*;
@ -133,33 +135,6 @@ pub struct ProvingKey<C: CurveAffine> {
permutation: permutation::ProvingKey<C>,
}
/// This is an error that could occur during proving or circuit synthesis.
// TODO: these errors need to be cleaned up
#[derive(Debug, PartialEq)]
pub enum Error {
/// This is an error that can occur during synthesis of the circuit, for
/// example, when the witness is not present.
SynthesisError,
/// The structured reference string or the parameters are not compatible
/// with the circuit being synthesized.
IncompatibleParams,
/// The constraint system is not satisfied.
ConstraintSystemFailure,
/// Out of bounds index passed to a backend
BoundsFailure,
/// Opening error
OpeningError,
/// Transcript error
TranscriptError,
/// Instance provided has more rows than supported by circuit
NotEnoughRowsAvailable,
/// Instance provided exceeds number of available rows
InstanceTooLarge,
/// Circuit synthesis requires global constants, but circuit configuration did not
/// call [`ConstraintSystem::enable_constant`] on fixed columns with sufficient space.
NotEnoughColumnsForConstants,
}
impl<C: CurveAffine> ProvingKey<C> {
/// Get the underlying [`VerifyingKey`].
pub fn get_vk(&self) -> &VerifyingKey<C> {

26
src/plonk/error.rs Normal file
View File

@ -0,0 +1,26 @@
/// This is an error that could occur during proving or circuit synthesis.
// TODO: these errors need to be cleaned up
#[derive(Debug, PartialEq)]
pub enum Error {
/// This is an error that can occur during synthesis of the circuit, for
/// example, when the witness is not present.
SynthesisError,
/// The structured reference string or the parameters are not compatible
/// with the circuit being synthesized.
IncompatibleParams,
/// The constraint system is not satisfied.
ConstraintSystemFailure,
/// Out of bounds index passed to a backend
BoundsFailure,
/// Opening error
OpeningError,
/// Transcript error
TranscriptError,
/// Instance provided has more rows than supported by circuit
NotEnoughRowsAvailable,
/// Instance provided exceeds number of available rows
InstanceTooLarge,
/// Circuit synthesis requires global constants, but circuit configuration did not
/// call [`ConstraintSystem::enable_constant`] on fixed columns with sufficient space.
NotEnoughColumnsForConstants,
}