Skip to content

Commit

Permalink
seal: add doc comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dr Maxim Orlovsky <[email protected]>
  • Loading branch information
dr-orlovsky committed Nov 18, 2024
1 parent 38699a3 commit 5036712
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions single_use_seals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ pub trait SingleUseSeal: Clone + Debug + Display {
}

pub trait ClientSideWitness {
/// Client-side witness is specific to just one type of single-use seals,
/// provided as an associated type.
type Seal: SingleUseSeal;
/// Proof which is passed from the client-side witness to the public-side
/// witness during single-use seal validation.
type Proof;
type Error: Clone + Error;

Expand All @@ -157,6 +161,8 @@ impl<Seal: SingleUseSeal> ClientSideWitness for NoWitness<Seal> {
fn convolve_commit(&self, msg: Seal::Message) -> Result<Self::Proof, Self::Error> { Ok(msg) }
}

/// Public witness can be used by multiple types of single-use seals, hence it
/// has the seal type as a generic parameter.
pub trait PublishedWitness<Seal: SingleUseSeal> {
/// Publication id that may be used for referencing publication of
/// witness data in the medium. By default, set `()`, so [`SingleUseSeal`]
Expand Down

0 comments on commit 5036712

Please sign in to comment.