From 7312fa93aca4e760f23162bda5f0a0e9de6e9204 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 | 5 +++++ src/composer/constraint_system/witness.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f30257..e536c00d 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 @@ -567,6 +571,7 @@ is necessary since `rkyv/validation` was required as a bound. - Proof system module. +[#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 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);