mirror of
https://github.com/vacp2p/pmtree.git
synced 2025-02-21 11:38:20 +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
|
||||
}
|
||||
|
||||
/// 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
|
||||
pub fn root(&self) -> H::Fr {
|
||||
self.root
|
||||
|
Loading…
x
Reference in New Issue
Block a user