mirror of
https://github.com/vacp2p/pmtree.git
synced 2025-02-17 17:56:26 +00:00
feat: add batch_insert function
This commit is contained in:
parent
ea8c7a5264
commit
6185354f78
@ -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"] }
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user