From 354693e523f34b8217bebb388be7d803cb0891ed Mon Sep 17 00:00:00 2001 From: moana Date: Tue, 27 Feb 2024 17:41:02 +0100 Subject: [PATCH] Add `Default` trait implementation for `Witness` Resolves #815 --- CHANGELOG.md | 4 ++++ src/composer/constraint_system/witness.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f30257..d32a4b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/composer/constraint_system/witness.rs b/src/composer/constraint_system/witness.rs index 61949fe0..2be31127 100644 --- a/src/composer/constraint_system/witness.rs +++ b/src/composer/constraint_system/witness.rs @@ -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);