sos_core/commit/
mod.rs

1//! Create and compare commits in an underlying merkle tree.
2mod proof;
3mod tree;
4
5use rs_merkle::{algorithms::Sha256, Hasher};
6use serde::{Deserialize, Serialize};
7
8/// Type for an Sha256 commit tree hash.
9pub type TreeHash = <Sha256 as Hasher>::Hash;
10
11/// Commit hash of zeroes.
12pub const ZERO: TreeHash = [0u8; 32];
13
14pub use proof::{CommitHash, CommitProof, Comparison};
15pub use tree::CommitTree;
16
17/// Commit state combines the last commit hash with
18/// a commit proof.
19#[derive(Default, Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
20pub struct CommitState(pub CommitHash, pub CommitProof);