feat: add batch_insert function

This commit is contained in:
Magamedrasul Ibragimov 2022-12-02 20:53:03 +03:00
parent ea8c7a5264
commit 6185354f78
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,9 @@ name = "pmtree"
version = "0.1.0"
edition = "2021"
[features]
batch_insert = []
[dev-dependencies]
hex-literal = "0.3.4"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }

View File

@ -188,6 +188,13 @@ where
Ok(())
}
/// Batch insertion, updates the tree in parallel.
/// Only available as a feature
#[cfg(feature = "batch_insert")]
pub fn batch_insert(&mut self, leaves: &[H::Fr]) -> Result<()> {
Ok(())
}
/// Computes a Merkle proof for the leaf at the specified index
pub fn proof(&self, index: usize) -> Result<MerkleProof<H>> {
if index >= self.capacity() {