Skip to content

Commit

Permalink
Lift the Default bound for the Circuit trait
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ureeves committed Dec 5, 2022
1 parent b765f44 commit 8ed3308
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -444,6 +448,7 @@ is necessary since `rkyv/validation` was required as a bound.
- Proof system module.

<!-- ISSUES -->
[#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
Expand Down
2 changes: 1 addition & 1 deletion src/composer/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<C>(&self, composer: &mut C) -> Result<(), Error>
where
Expand Down
2 changes: 1 addition & 1 deletion src/composer/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Compiler {
label: &[u8],
) -> Result<(Prover<C>, Verifier<C>), Error>
where
C: Circuit,
C: Default + Circuit,
{
Self::compile_with_circuit(pp, label, &Default::default())
}
Expand Down

0 comments on commit 8ed3308

Please sign in to comment.