Skip to content

Commit

Permalink
commit: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 2, 2024
1 parent 277b4fa commit c8bb6f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions commit_verify/derive/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum StrategyAttr {
ConcealStrict,
Transparent,
Merklize,
// TODO: Add Hash strategy
}

impl TryFrom<&Path> for StrategyAttr {
Expand Down
9 changes: 3 additions & 6 deletions commit_verify/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl CommitEngine {

pub fn commit_to_hash<T: CommitEncode<CommitmentId = StrictHash> + StrictType>(
&mut self,
value: T,
value: &T,
) {
let fqn = commitment_fqn::<T>();
self.layout
Expand Down Expand Up @@ -209,9 +209,6 @@ impl CommitEngine {
pub fn finish_layout(self) -> (Sha256, TinyVec<CommitStep>) { (self.hasher, self.layout) }
}

/// Prepares the data to the *consensus commit* procedure by first running
/// necessary conceal and merklization procedures, and them performing strict
/// encoding for the resulted data.
pub trait CommitEncode {
/// Type of the resulting commitment.
type CommitmentId: CommitmentId;
Expand Down Expand Up @@ -263,7 +260,7 @@ where T: CommitEncode + StrictDumb

/// High-level API used in client-side validation for producing a single
/// commitment to the data, which includes running all necessary procedures like
/// concealment with [`crate::Conceal`], merklization, strict encoding,
/// concealment with [`Conceal`], merklization, strict encoding,
/// wrapped into [`CommitEncode`], followed by the actual commitment to its
/// output.
///
Expand Down Expand Up @@ -291,7 +288,7 @@ impl<T: CommitEncode> CommitId for T {

#[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)]
#[wrapper(Deref, BorrowSlice, Display, FromStr, Hex, Index, RangeOps)]
#[derive(StrictDumb, strict_encoding::StrictType, StrictEncode, StrictDecode)]
#[derive(StrictDumb, StrictType, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_COMMIT_VERIFY)]
#[cfg_attr(
feature = "serde",
Expand Down
1 change: 1 addition & 0 deletions commit_verify/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ impl MerkleHash {

pub trait MerkleLeaves {
type Leaf: CommitId<CommitmentId = MerkleHash>;
// TODO: Remove associated type
type LeafIter<'tmp>: ExactSizeIterator<Item = Self::Leaf>
where Self: 'tmp;

Expand Down

0 comments on commit c8bb6f1

Please sign in to comment.