Skip to content

Commit

Permalink
Merge pull request #816 from dusk-network/mocello/815_default_witness
Browse files Browse the repository at this point in the history
Add `Default` trait implementation for `Witness`
  • Loading branch information
moCello authored Feb 28, 2024
2 parents 7505e9a + 7312fa9 commit d40aca9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Reduce hades constants count in circuit compression from 960 to 335 [#813]

### Added

- Add `Default` trait for `Witness` [#815]

## [0.19.0] - 2024-01-03

### Fixed
Expand Down Expand Up @@ -567,6 +571,7 @@ is necessary since `rkyv/validation` was required as a bound.
- Proof system module.

<!-- ISSUES -->
[#815]: https://github.com/dusk-network/plonk/issues/815
[#813]: https://github.com/dusk-network/plonk/issues/813
[#805]: https://github.com/dusk-network/plonk/issues/805
[#804]: https://github.com/dusk-network/plonk/issues/804
Expand Down
6 changes: 6 additions & 0 deletions src/composer/constraint_system/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ pub struct Witness {
index: usize,
}

impl Default for Witness {
fn default() -> Self {
crate::composer::Composer::ZERO
}
}

impl Witness {
/// A `0` witness representation.
pub const ZERO: Witness = Witness::new(0);
Expand Down

0 comments on commit d40aca9

Please sign in to comment.