From 132ed3e4fbf29337adf57e0082579c6a68d709d0 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 22 Dec 2024 20:01:26 +0100 Subject: [PATCH] seals: add merge method to client witness --- single_use_seals/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/single_use_seals/src/lib.rs b/single_use_seals/src/lib.rs index 1037fac6..93235b3d 100644 --- a/single_use_seals/src/lib.rs +++ b/single_use_seals/src/lib.rs @@ -179,6 +179,9 @@ pub trait ClientSideWitness: Eq { &self, msg: ::Message, ) -> Result; + + fn merge(&mut self, other: Self) -> Result<(), Self::Error> + where Self: Sized; } #[derive(Copy, Clone, Debug, Default)] @@ -195,6 +198,11 @@ impl ClientSideWitness for NoWitness { type Error = Infallible; fn convolve_commit(&self, msg: Seal::Message) -> Result { Ok(msg) } + + fn merge(&mut self, _: Self) -> Result<(), Self::Error> + where Self: Sized { + Ok(()) + } } /// Public witness can be used by multiple types of single-use seals, hence it