From 8ed330858fe5f1b57f54d8992dad31639e2c24a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Leegwater=20Sim=C3=B5es?= Date: Mon, 5 Dec 2022 13:57:43 +0100 Subject: [PATCH] Lift the `Default` bound for the `Circuit` trait The `Compiler::compile` function keeps this bound since it actually requires the circuit to have a `Default` implementation, but all other functionality now works without said bound. Resolves #715 --- CHANGELOG.md | 5 +++++ src/composer/circuit.rs | 2 +- src/composer/compiler.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a23157d1..915e8399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Lift `Default` bound on the `Circuit` trait [#715] + ## [0.13.1] - 2022-10-26 ### Fixed @@ -444,6 +448,7 @@ is necessary since `rkyv/validation` was required as a bound. - Proof system module. +[#715]: https://github.com/dusk-network/plonk/issues/715 [#709]: https://github.com/dusk-network/plonk/issues/709 [#697]: https://github.com/dusk-network/plonk/issues/697 [#688]: https://github.com/dusk-network/plonk/issues/688 diff --git a/src/composer/circuit.rs b/src/composer/circuit.rs index ffb545bd..c11abf2d 100644 --- a/src/composer/circuit.rs +++ b/src/composer/circuit.rs @@ -11,7 +11,7 @@ use super::Composer; /// Circuit implementation that can be proved by a Composer /// /// The default implementation will be used to generate the proving arguments. -pub trait Circuit: Default { +pub trait Circuit { /// Circuit definition fn circuit(&self, composer: &mut C) -> Result<(), Error> where diff --git a/src/composer/compiler.rs b/src/composer/compiler.rs index 2208ad42..dceb45d4 100644 --- a/src/composer/compiler.rs +++ b/src/composer/compiler.rs @@ -26,7 +26,7 @@ impl Compiler { label: &[u8], ) -> Result<(Prover, Verifier), Error> where - C: Circuit, + C: Default + Circuit, { Self::compile_with_circuit(pp, label, &Default::default()) }