some refactoring

This commit is contained in:
Simon Gardling
2022-05-16 16:46:23 -04:00
parent 490e4bffbd
commit 62944783ca
3 changed files with 25 additions and 21 deletions

View File

@@ -97,9 +97,15 @@ fn hashed_storage() {
.chars()
.map(|c| c as u8)
.collect::<Vec<u8>>();
let storage = hashed_storage_create(commit.as_slice(), data.as_slice());
let storage = hashed_storage_create(
commit
.as_slice()
.try_into()
.expect("cannot turn into [u8; 8]"),
data.as_slice(),
);
let read = hashed_storage_read(storage);
assert_eq!(read.0.chars().map(|c| c as u8).collect::<Vec<u8>>(), commit);
assert_eq!(read.0.to_vec(), commit);
assert_eq!(read.1, data);
}