mirror of
https://github.com/vacp2p/pmtree.git
synced 2025-02-22 20:18:21 +00:00
Merge branch 'Rate-Limiting-Nullifier:main' into make-db-public
This commit is contained in:
commit
8b005bb44a
@ -344,6 +344,15 @@ where
|
|||||||
self.root() == expected_root
|
self.root() == expected_root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the leaf by the key
|
||||||
|
pub fn get(&self, key: usize) -> PmtreeResult<H::Fr> {
|
||||||
|
if key >= self.capacity() {
|
||||||
|
return Err(PmtreeErrorKind::TreeError(TreeErrorKind::IndexOutOfBounds));
|
||||||
|
}
|
||||||
|
|
||||||
|
self.get_elem(Key(self.depth, key))
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the root of the tree
|
/// Returns the root of the tree
|
||||||
pub fn root(&self) -> H::Fr {
|
pub fn root(&self) -> H::Fr {
|
||||||
self.root
|
self.root
|
||||||
|
Loading…
x
Reference in New Issue
Block a user