Trait CommitmentChain

Source
pub trait CommitmentChain: Commitment {
    // Required methods
    fn commitments(&self) -> &Vec<Box<dyn Commitment>>;
    fn mut_commitments(&mut self) -> &mut Vec<Box<dyn Commitment>>;
    fn append(
        &mut self,
        trivial_commitment: Box<dyn TrivialCommitment>,
    ) -> CommitmentResult<()>;
}
Expand description

A chain of commitments in which the target in the n’th commitment is identical to the expected data in the (n+1)’th commitment

Required Methods§

Source

fn commitments(&self) -> &Vec<Box<dyn Commitment>>

Gets the sequence of commitments.

Source

fn mut_commitments(&mut self) -> &mut Vec<Box<dyn Commitment>>

Gets the sequence of commitments as a mutable reference.

Source

fn append( &mut self, trivial_commitment: Box<dyn TrivialCommitment>, ) -> CommitmentResult<()>

Appends a TrivialCommitment to extend this IterableCommitment.

The appended commitment must be endowed with expected data identical to the hash of this commitment, so the resulting iterable commitment is itself a commitment to the same expected data.

Implementors§