Skip to content

Commit

Permalink
make get_elem public (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
seemenkina authored May 17, 2024
1 parent ec1d06c commit ce0211d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DEFAULT_TREE_DEPTH: usize = 20;
// Denotes keys (depth, index) in Merkle Tree. Can be converted to DBKey
// TODO! Think about using hashing for that
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
struct Key(usize, usize);
pub struct Key(usize, usize);
impl From<Key> for DBKey {
fn from(key: Key) -> Self {
let cantor_pairing = ((key.0 + key.1) * (key.0 + key.1 + 1) / 2 + key.1) as u64;
Expand Down Expand Up @@ -180,7 +180,7 @@ where
}

// Returns elem by the key
fn get_elem(&self, key: Key) -> PmtreeResult<H::Fr> {
pub fn get_elem(&self, key: Key) -> PmtreeResult<H::Fr> {
let res = self
.db
.get(key.into())?
Expand Down

0 comments on commit ce0211d

Please sign in to comment.