Skip to content

Commit

Permalink
Remove unneeded derive(Serialize, Deserialize) (easy) (#289)
Browse files Browse the repository at this point in the history
* removing uneeded derive(Deserialize) in src/circuit.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/hyperkzg.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/ipa_pc.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/pedersen.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/non_hiding_zeromorph.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/kzg_commitment.rs

* removing uneeded derive(Serialize, Deserialize) in src/provider/poseidon.rs

* removing uneeded derive(Deserialize) in src/supernova/mod.rs
  • Loading branch information
huitseeker committed Feb 2, 2024
1 parent 1942595 commit b168f27
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl NovaAugmentedCircuitParams {
}
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize)]
#[serde(bound = "")]
pub struct NovaAugmentedCircuitInputs<E: Engine> {
params: E::Scalar,
Expand Down
2 changes: 1 addition & 1 deletion src/provider/hyperkzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct EvaluationArgument<E: Engine> {
}

/// Provides an implementation of a polynomial evaluation engine using KZG
#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug)]
pub struct EvaluationEngine<E, NE> {
_p: PhantomData<(E, NE)>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/provider/ipa_pc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct VerifierKey<E: Engine> {
impl<E: Engine> SimpleDigestible for VerifierKey<E> {}

/// Provides an implementation of a polynomial evaluation engine using IPA
#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug)]
pub struct EvaluationEngine<E> {
_p: PhantomData<E>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/provider/kzg_commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::provider::{
};

/// Provides a commitment engine
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct KZGCommitmentEngine<E> {
_p: PhantomData<E>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/provider/non_hiding_zeromorph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn trim_zeromorph<E: Engine>(
}

/// Commitments
#[derive(Debug, Clone, Eq, PartialEq, Default, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct ZMCommitment<E: Engine>(
/// the actual commitment is an affine point.
E::G1Affine,
Expand Down
2 changes: 1 addition & 1 deletion src/provider/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ where
}

/// Provides a commitment engine
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CommitmentEngine<E> {
_p: PhantomData<E>,
}
Expand Down
4 changes: 2 additions & 2 deletions src/provider/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<Scalar: PrimeField> Default for PoseidonConstantsCircuit<Scalar> {
}

/// A Poseidon-based RO to use outside circuits
#[derive(Debug, Serialize, Deserialize, Abomonation)]
#[derive(Debug, Abomonation)]
#[abomonation_bounds(
where
Base: PrimeField,
Expand Down Expand Up @@ -115,7 +115,7 @@ where
}

/// A Poseidon-based RO gadget to use inside the verifier circuit.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug)]
pub struct PoseidonROCircuit<Scalar: PrimeField> {
// Internal state
state: Vec<AllocatedNum<Scalar>>,
Expand Down
9 changes: 4 additions & 5 deletions src/supernova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use circuit::{
use error::SuperNovaError;

/// A struct that manages all the digests of the primary circuits of a SuperNova instance
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Serialize)]
pub struct CircuitDigests<E: Engine> {
digests: Vec<E::Scalar>,
}
Expand Down Expand Up @@ -80,7 +80,7 @@ impl<E: Engine> CircuitDigests<E> {
}

/// A vector of [`R1CSWithArity`] adjoined to a set of [`PublicParams`]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize)]
#[serde(bound = "")]
pub struct PublicParams<E1, E2, C1, C2>
where
Expand Down Expand Up @@ -112,7 +112,7 @@ where
/// Auxiliary [`PublicParams`] information about the commitment keys and
/// secondary circuit. This is used as a helper struct when reconstructing
/// [`PublicParams`] downstream in lurk.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(bound = "")]
pub struct AuxParams<E1, E2>
where
Expand All @@ -135,8 +135,7 @@ where

/// A variant of [`crate::supernova::AuxParams`] that is suitable for fast ser/de using Abomonation
#[cfg(feature = "abomonate")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Abomonation)]
#[serde(bound = "")]
#[derive(Debug, Clone, PartialEq, Abomonation)]
#[abomonation_bounds(
where
E1: Engine<Base = <E2 as Engine>::Scalar>,
Expand Down

0 comments on commit b168f27

Please sign in to comment.