Skip to content

Commit

Permalink
feat: replace ic-certified-map with ic-certification
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Nov 17, 2023
1 parent 97f4ece commit e5dc91d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 211 deletions.
9 changes: 4 additions & 5 deletions src/satellite/src/storage/certification/impls.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::storage::certification::constants::{
EXACT_MATCH_TERMINATOR, LABEL_ASSETS_V1, LABEL_ASSETS_V2, WILDCARD_MATCH_TERMINATOR,
};
use crate::storage::certification::tree::merge_hash_trees;
use crate::storage::certification::tree_utils::{
fallback_paths, nested_tree_expr_path, nested_tree_key, nested_tree_path,
};
Expand All @@ -16,7 +15,7 @@ use crate::storage::types::config::StorageConfig;
use crate::storage::types::state::FullPath;
use crate::storage::types::store::Asset;
use crate::storage::url::alternative_paths;
use ic_certification::{fork, fork_hash, labeled, labeled_hash, AsHashTree, Hash, HashTree};
use ic_certification::{fork, fork_hash, labeled, labeled_hash, merge_hash_trees, AsHashTree, Hash, HashTree, pruned};
use sha2::{Digest, Sha256};

impl CertifiedAssetHashes {
Expand All @@ -33,7 +32,7 @@ impl CertifiedAssetHashes {
let witness = self.tree_v1.witness(path.as_bytes());
fork(
labeled(LABEL_ASSETS_V1, witness),
HashTree::Pruned(labeled_hash(LABEL_ASSETS_V2, &self.tree_v2.root_hash())),
pruned(labeled_hash(LABEL_ASSETS_V2, &self.tree_v2.root_hash())),
)
}

Expand All @@ -44,7 +43,7 @@ impl CertifiedAssetHashes {
let witness = self.tree_v2.witness(&segments);

fork(
HashTree::Pruned(labeled_hash(LABEL_ASSETS_V1, &self.tree_v1.root_hash())),
pruned(labeled_hash(LABEL_ASSETS_V1, &self.tree_v1.root_hash())),
labeled(LABEL_ASSETS_V2, witness),
)
}
Expand All @@ -68,7 +67,7 @@ impl CertifiedAssetHashes {
});

fork(
HashTree::Pruned(labeled_hash(LABEL_ASSETS_V1, &self.tree_v1.root_hash())),
pruned(labeled_hash(LABEL_ASSETS_V1, &self.tree_v1.root_hash())),
labeled(LABEL_ASSETS_V2, combined_proof),
)
}
Expand Down
1 change: 0 additions & 1 deletion src/satellite/src/storage/certification/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub mod cert;
mod constants;
mod impls;
mod tree;
mod tree_utils;
pub mod types;
203 changes: 0 additions & 203 deletions src/satellite/src/storage/certification/tree.rs

This file was deleted.

3 changes: 1 addition & 2 deletions src/satellite/src/storage/certification/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod certified {
use crate::storage::certification::tree::NestedTree;
use crate::types::core::Blob;
use ic_certification::{Hash, RbTree};
use ic_certification::{Hash, NestedTree, RbTree};
use std::clone::Clone;

#[derive(Default, Clone)]
Expand Down

0 comments on commit e5dc91d

Please sign in to comment.