diff --git a/src/sparse_mpt/diff_trie/tests.rs b/src/sparse_mpt/diff_trie/tests.rs index 5bcaa1c..90fdcb7 100644 --- a/src/sparse_mpt/diff_trie/tests.rs +++ b/src/sparse_mpt/diff_trie/tests.rs @@ -31,6 +31,13 @@ fn compare_impls_with_hashing(data: Vec<(Bytes, Bytes)>, insert_hashing: bool) { "comparing hashing, insert_hashing: {}", insert_hashing ); + + let got_parallel = trie.root_hash_parallel().expect("hashing failed"); + assert_eq!( + got_parallel, expected, + "comparing parallel hashing, insert_hashing: {}", + insert_hashing + ); } fn compare_sparse_impl(mut data: Vec<(Bytes, Bytes)>, insert_hashing: bool) { @@ -64,6 +71,9 @@ fn compare_sparse_impl(mut data: Vec<(Bytes, Bytes)>, insert_hashing: bool) { } let got = gathered_trie.root_hash().expect("can't hash gathered trie"); assert_eq!(got, expected); + + let got_parallel = gathered_trie.root_hash_parallel().expect("can't hash gathered trie"); + assert_eq!(got_parallel, expected); } fn compare_impls(data: &[(Vec, Vec)]) { @@ -208,6 +218,13 @@ fn compare_with_removals_with_hashing( insert_hashing ); + let parallel_hash = trie.root_hash_parallel().expect("must hash"); + assert_eq!( + parallel_hash, reference_hash, + "comparing parallel hashing, insert_hashing: {}", + insert_hashing + ); + Ok(()) } @@ -246,6 +263,13 @@ fn compare_with_removals_sparse( insert_hashing ); + let parallel_hash = gathered_trie.root_hash_parallel().expect("must hash"); + assert_eq!( + parallel_hash, reference_hash, + "comparing sparse removals parallel hashing, insert_hashing: {}", + insert_hashing + ); + Ok(()) }