diff --git a/commit_verify/src/id.rs b/commit_verify/src/id.rs index 58cc2855..600e5470 100644 --- a/commit_verify/src/id.rs +++ b/commit_verify/src/id.rs @@ -99,6 +99,15 @@ impl CommitEngine { self.inner_commit_to::<_, COMMIT_MAX_LEN>(&value); } + pub fn commit_to_option(&mut self, value: &Option) { + let fqn = commitment_fqn::(); + self.layout + .push(CommitStep::Serialized(fqn)) + .expect("too many fields for commitment"); + + self.inner_commit_to::<_, COMMIT_MAX_LEN>(&value); + } + pub fn commit_to_hash + StrictType>( &mut self, value: T,