Skip to content

Commit

Permalink
Add Default trait implementation for Witness
Browse files Browse the repository at this point in the history
Resolves #815
  • Loading branch information
moCello committed Feb 27, 2024
1 parent 7505e9a commit 9baa8b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 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
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 {
Self::ZERO
}
}

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

0 comments on commit 9baa8b7

Please sign in to comment.