Increase detail of cached hashing testing
This commit is contained in:
parent
80fa5d08c5
commit
b70ebd09ea
@ -29,13 +29,34 @@ where
|
||||
// Create a new hasher from the "modified" struct.
|
||||
let modified_hasher = CachedTreeHasher::new(modified).unwrap();
|
||||
|
||||
// Test that the modified hasher has the same number of chunks as a newly built hasher.
|
||||
assert_eq!(
|
||||
hasher.cache.chunk_modified.len(),
|
||||
modified_hasher.cache.chunk_modified.len(),
|
||||
"Number of chunks is different"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
hasher.cache.cache.len(),
|
||||
modified_hasher.cache.cache.len(),
|
||||
"Number of bytes is different"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
hasher.cache.cache, modified_hasher.cache.cache,
|
||||
"Bytes are different"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
hasher.cache.schemas.len(),
|
||||
modified_hasher.cache.schemas.len(),
|
||||
"Number of schemas is different"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
hasher.cache.schemas, modified_hasher.cache.schemas,
|
||||
"Schemas are different"
|
||||
);
|
||||
|
||||
// Test the root generated by the updated hasher matches a non-cached tree hash root.
|
||||
let standard_root = modified.tree_hash_root();
|
||||
let cached_root = hasher
|
||||
|
Loading…
Reference in New Issue
Block a user