use anyhow::Result;
use xchecker_utils::error::XCheckerError;
use xchecker_utils::types::{FileHash, FileType};
use super::ReceiptManager;
impl ReceiptManager {
pub fn create_file_hash(
&self,
file_path: &str,
content: &str,
file_type: FileType,
phase: &str,
) -> Result<FileHash, XCheckerError> {
let blake3_hash = self
.canonicalizer
.hash_canonicalized_with_context(content, file_type, phase)?;
Ok(FileHash {
path: file_path.to_string(),
blake3_canonicalized: blake3_hash,
})
}
}