From 327416bf6b308d0447b36b3a451310e7c2137952 Mon Sep 17 00:00:00 2001 From: amosStarkware <88497213+amosStarkware@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:07:17 +0200 Subject: [PATCH] fix: changes to api (#44) --- crates/committer/src/patricia_merkle_tree/filled_tree.rs | 4 +++- .../src/patricia_merkle_tree/original_skeleton_tree.rs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/committer/src/patricia_merkle_tree/filled_tree.rs b/crates/committer/src/patricia_merkle_tree/filled_tree.rs index 161448dd..f733e229 100644 --- a/crates/committer/src/patricia_merkle_tree/filled_tree.rs +++ b/crates/committer/src/patricia_merkle_tree/filled_tree.rs @@ -7,6 +7,7 @@ use crate::patricia_merkle_tree::errors::FilledTreeError; use crate::patricia_merkle_tree::filled_node::FilledNode; use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex}; use crate::storage::storage_trait::Storage; +use crate::storage::storage_trait::StorageKey; /// Consider a Patricia-Merkle Tree which has been updated with new leaves. /// FilledTree consists of all nodes which were modified in the update, including their updated @@ -14,7 +15,8 @@ use crate::storage::storage_trait::Storage; pub(crate) trait FilledTree { /// Serializes the tree into storage. Returns hash set of keys of the serialized nodes, /// if successful. - fn serialize(&self, storage: impl Storage) -> Result, FilledTreeError>; + fn serialize(&self, storage: &mut impl Storage) + -> Result, FilledTreeError>; } pub(crate) struct FilledTreeImpl { diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs index 710029d2..c51a6c59 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs @@ -15,11 +15,11 @@ pub(crate) type OriginalSkeletonTreeResult = Result { fn compute_original_skeleton_tree( - storage: impl Storage, - leaf_indices: &[NodeIndex], + storage: &impl Storage, + leaf_indices: [NodeIndex], root_hash: HashOutput, tree_height: TreeHeight, - ) -> OriginalSkeletonTreeResult>; + ) -> OriginalSkeletonTreeResult>; /// Computes and returns updated skeleton tree. fn compute_updated_skeleton_tree(