-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c434a2a
commit b0a91b5
Showing
5 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod patricia_merkle_node; | ||
pub mod patricia_merkle_tree; | ||
pub mod node; | ||
pub mod tree; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub struct Node {} |
1 change: 0 additions & 1 deletion
1
crates/committer/src/patricia_merkle_tree/patricia_merkle_node.rs
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
crates/committer/src/patricia_merkle_tree/patricia_merkle_tree.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::patricia_merkle_tree::node::Node; | ||
|
||
|
||
trait Tree { | ||
/// Returns the node with given full (Merkle) index, if it exists. | ||
fn get_node(full_index: u128) -> Option<Node>; | ||
|
||
/// Returns the root if the tree is not empty. | ||
fn get_root() -> Option<Node>; | ||
|
||
/// Computes the hash of the given node. | ||
fn compute_hash(node: Node) -> [u8; 32]; | ||
} |