BREAKCHANGE: support multi leaves merkle proof

This commit is contained in:
jjy
2020-02-01 19:14:18 +08:00
parent aad0eddc94
commit 17ebbeebe5
7 changed files with 362 additions and 134 deletions
+6
View File
@@ -5,6 +5,10 @@ pub enum Error {
GetRootOnEmpty,
InconsistentStore,
StoreError(crate::string::String),
/// proof items is not enough to build a tree
CorruptedProof,
/// The leaves is an empty list, or beyond the mmr range
GenProofForInvalidLeaves,
}
impl core::fmt::Display for Error {
@@ -14,6 +18,8 @@ impl core::fmt::Display for Error {
GetRootOnEmpty => write!(f, "Get root on an empty MMR")?,
InconsistentStore => write!(f, "Inconsistent store")?,
StoreError(msg) => write!(f, "Store error {}", msg)?,
CorruptedProof => write!(f, "Corrupted proof")?,
GenProofForInvalidLeaves => write!(f, "Generate proof ofr invalid leaves")?,
}
Ok(())
}