Skip to content

Commit

Permalink
seals: add merge method to client witness
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 22, 2024
1 parent 3b0be3c commit 132ed3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions single_use_seals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ pub trait ClientSideWitness: Eq {
&self,
msg: <Self::Seal as SingleUseSeal>::Message,
) -> Result<Self::Proof, Self::Error>;

fn merge(&mut self, other: Self) -> Result<(), Self::Error>
where Self: Sized;
}

#[derive(Copy, Clone, Debug, Default)]
Expand All @@ -195,6 +198,11 @@ impl<Seal: SingleUseSeal> ClientSideWitness for NoWitness<Seal> {
type Error = Infallible;

fn convolve_commit(&self, msg: Seal::Message) -> Result<Self::Proof, Self::Error> { 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
Expand Down

0 comments on commit 132ed3e

Please sign in to comment.