-
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.
refactor: rename current skeleton to original (#33)
- Loading branch information
Showing
4 changed files
with
10 additions
and
10 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,8 +1,8 @@ | ||
pub mod current_skeleton_node; | ||
pub mod current_skeleton_tree; | ||
pub mod errors; | ||
pub mod filled_node; | ||
pub mod filled_tree; | ||
pub mod original_skeleton_node; | ||
pub mod original_skeleton_tree; | ||
pub mod types; | ||
pub mod updated_skeleton_node; | ||
pub mod updated_skeleton_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
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
12 changes: 6 additions & 6 deletions
12
...icia_merkle_tree/current_skeleton_tree.rs → ...cia_merkle_tree/original_skeleton_tree.rs
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,30 +1,30 @@ | ||
use std::collections::HashMap; | ||
|
||
use crate::hash::types::{HashFunction, HashOutput}; | ||
use crate::patricia_merkle_tree::errors::CurrentSkeletonTreeError; | ||
use crate::patricia_merkle_tree::errors::OriginalSkeletonTreeError; | ||
use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex, TreeHashFunction, TreeHeight}; | ||
use crate::patricia_merkle_tree::updated_skeleton_tree::UpdatedSkeletonTree; | ||
use crate::storage::storage_trait::Storage; | ||
|
||
#[allow(dead_code)] | ||
pub(crate) type CurrentSkeletonTreeResult<T> = Result<T, CurrentSkeletonTreeError>; | ||
pub(crate) type OriginalSkeletonTreeResult<T> = Result<T, OriginalSkeletonTreeError>; | ||
|
||
/// Consider a Patricia-Merkle Tree which should be updated with new leaves. | ||
/// This trait represents the structure of the subtree which will be modified in the | ||
/// update. It also contains the hashes (for edge siblings - also the edge data) of the Sibling | ||
/// nodes on the Merkle paths from the updated leaves to the root. | ||
pub(crate) trait CurrentSkeletonTree<L: LeafDataTrait, H: HashFunction, TH: TreeHashFunction<L, H>> | ||
pub(crate) trait OriginalSkeletonTree<L: LeafDataTrait, H: HashFunction, TH: TreeHashFunction<L, H>> | ||
{ | ||
fn compute_current_skeleton_tree( | ||
fn compute_original_skeleton_tree( | ||
storage: impl Storage, | ||
leaf_indices: &[NodeIndex], | ||
root_hash: HashOutput, | ||
tree_height: TreeHeight, | ||
) -> CurrentSkeletonTreeResult<Box<Self>>; | ||
) -> OriginalSkeletonTreeResult<Box<Self>>; | ||
|
||
/// Computes and returns updated skeleton tree. | ||
fn compute_updated_skeleton_tree( | ||
&self, | ||
index_to_updated_leaf: HashMap<NodeIndex, L>, | ||
) -> CurrentSkeletonTreeResult<impl UpdatedSkeletonTree<L, H, TH>>; | ||
) -> OriginalSkeletonTreeResult<impl UpdatedSkeletonTree<L, H, TH>>; | ||
} |