Skip to content

Commit 6d471bd

Browse files
committed
starknet_committer: move fetch_patricia_paths tests
1 parent 4c3049b commit 6d471bd

3 files changed

Lines changed: 19 additions & 20 deletions

File tree

crates/starknet_committer/src/db.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ pub mod forest_trait;
88
pub mod index_db;
99
pub mod serde_db_utils;
1010
pub mod trie_traversal;
11+
12+
#[cfg(test)]
13+
mod fetch_patricia_paths_tests;

crates/starknet_committer/src/db/facts_db/traversal_test.rs renamed to crates/starknet_committer/src/db/fetch_patricia_paths_tests.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -718,14 +718,14 @@ fn parse_json_test_input(
718718
/// The files names indicate the tree height, number of initial leaves and number of modified
719719
/// leaves. The hash function used in the python tests is Pedersen.
720720
/// The leaves values are their NodeIndices.
721-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_200_50.json"))]
722-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_5_2.json"))]
723-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_100_30.json"))]
724-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_8_120_70.json"))]
725-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_200_50.json"))]
726-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_5_2.json"))]
727-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_100_30.json"))]
728-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_8_120_70.json"))]
721+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_200_50.json"))]
722+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_5_2.json"))]
723+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_100_30.json"))]
724+
#[case(include_str!("../../resources/fetch_patricia_paths_test_8_120_70.json"))]
725+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_200_50.json"))]
726+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_5_2.json"))]
727+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_100_30.json"))]
728+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_8_120_70.json"))]
729729
async fn test_fetch_patricia_paths_inner_from_json_facts_layout(#[case] input_data: &str) {
730730
let (storage, leaf_indices, root_hash, height, expected_nodes) =
731731
parse_json_test_input(input_data);
@@ -747,14 +747,14 @@ async fn test_fetch_patricia_paths_inner_from_json_facts_layout(#[case] input_da
747747
/// The files names indicate the tree height, number of initial leaves and number of modified
748748
/// leaves. The hash function used in the python tests is Pedersen.
749749
/// The leaves values are their NodeIndices.
750-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_200_50.json"))]
751-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_5_2.json"))]
752-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_10_100_30.json"))]
753-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_8_120_70.json"))]
754-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_200_50.json"))]
755-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_5_2.json"))]
756-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_10_100_30.json"))]
757-
#[case(include_str!("../../../resources/fetch_patricia_paths_test_delete_leaves_8_120_70.json"))]
750+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_200_50.json"))]
751+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_5_2.json"))]
752+
#[case(include_str!("../../resources/fetch_patricia_paths_test_10_100_30.json"))]
753+
#[case(include_str!("../../resources/fetch_patricia_paths_test_8_120_70.json"))]
754+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_200_50.json"))]
755+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_5_2.json"))]
756+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_10_100_30.json"))]
757+
#[case(include_str!("../../resources/fetch_patricia_paths_test_delete_leaves_8_120_70.json"))]
758758
async fn test_fetch_patricia_paths_inner_from_json_index_layout(#[case] input_data: &str) {
759759
let (mut storage, leaf_indices, root_hash, height, expected_nodes) =
760760
parse_json_test_input(input_data);

crates/starknet_committer/src/db/trie_traversal.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ use crate::patricia_merkle_tree::leaf::leaf_impl::ContractState;
5353
use crate::patricia_merkle_tree::tree::OriginalSkeletonTrieConfig;
5454
use crate::patricia_merkle_tree::types::CompiledClassHash;
5555

56-
#[cfg(test)]
57-
#[path = "facts_db/traversal_test.rs"]
58-
mod traversal_test;
59-
6056
/// Logs out a warning of a trivial modification.
6157
macro_rules! log_trivial_modification {
6258
($index:expr, $value:expr) => {

0 commit comments

Comments
 (0)