mirror of
https://github.com/vacp2p/zerokit.git
synced 2026-01-10 06:58:03 -05:00
feat(rln): improve the PmTreeConfig initialization process with builder pattern (#334)
This commit is contained in:
@@ -26,6 +26,8 @@ pub enum ZerokitMerkleTreeError {
|
||||
pub enum FromConfigError {
|
||||
#[error("Error while reading pmtree config: {0}")]
|
||||
JsonError(#[from] serde_json::Error),
|
||||
#[error("Error while creating pmtree config: missing path")]
|
||||
MissingPath,
|
||||
#[error("Error while creating pmtree config: path already exists")]
|
||||
PathExists,
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ where
|
||||
*self
|
||||
.nodes
|
||||
.get(&(depth, index))
|
||||
.unwrap_or_else(|| &self.cached_nodes[depth])
|
||||
.unwrap_or(&self.cached_nodes[depth])
|
||||
}
|
||||
|
||||
/// Computes the hash of a node’s two children at the given depth.
|
||||
|
||||
Reference in New Issue
Block a user