strictly generate and verify proofs for leaves

This commit is contained in:
Robert Hambrock
2022-07-28 10:37:27 +02:00
parent 122e6e4e46
commit 8e333a2329
4 changed files with 145 additions and 7 deletions
+3
View File
@@ -7,6 +7,8 @@ pub enum Error {
StoreError(crate::string::String),
/// proof items is not enough to build a tree
CorruptedProof,
/// tried to verify proof of a non-leaf
NodeProofsNotSupported,
/// The leaves is an empty list, or beyond the mmr range
GenProofForInvalidLeaves,
@@ -22,6 +24,7 @@ impl core::fmt::Display for Error {
InconsistentStore => write!(f, "Inconsistent store")?,
StoreError(msg) => write!(f, "Store error {}", msg)?,
CorruptedProof => write!(f, "Corrupted proof")?,
NodeProofsNotSupported => write!(f, "Tried to verify membership of a non-leaf")?,
GenProofForInvalidLeaves => write!(f, "Generate proof ofr invalid leaves")?,
MergeError(msg) => write!(f, "Merge error {}", msg)?,
}