Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Feb 3, 2024
1 parent 7e6b298 commit e599e17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/merkle/smt/full/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ impl SparseMerkleTree<SMT_DEPTH> for Smt {
let most_significant_felt = key[3];
LeafIndex::new_max_depth(most_significant_felt.as_int())
}

}

impl Default for Smt {
Expand Down
6 changes: 5 additions & 1 deletion src/merkle/smt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ pub(crate) trait SparseMerkleTree<const DEPTH: u8> {
let is_right = index.is_value_odd();
index.move_up();
let InnerNode { left, right } = self.get_inner_node(index);
let (left, right) = if is_right { (left, node_hash) } else { (node_hash, right) };
let (left, right) = if is_right {
(left, node_hash)
} else {
(node_hash, right)
};
node_hash = Rpo256::merge(&[left, right]);

if node_hash == *EmptySubtreeRoots::entry(DEPTH, node_depth) {
Expand Down
2 changes: 1 addition & 1 deletion src/merkle/smt/simple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl<const DEPTH: u8> SparseMerkleTree<DEPTH> for SimpleSmt<DEPTH> {
fn insert_inner_node(&mut self, index: NodeIndex, inner_node: InnerNode) {
self.inner_nodes.insert(index, inner_node);
}

fn remove_inner_node(&mut self, index: NodeIndex) {
let _ = self.inner_nodes.remove(&index);
}
Expand Down

0 comments on commit e599e17

Please sign in to comment.