MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_change

Method get_change

atomic-core/src/pristine/span_patch_storage/build_tests.rs:355–364  ·  view source on GitHub ↗
(&self, hash: &Hash)

Source from the content-addressed store, hash-verified

353impl ChangeStore for TamperedStore<'_> {
354 type Error = <MemoryChangeStore as ChangeStore>::Error;
355 fn get_change(&self, hash: &Hash) -> std::result::Result<Change, Self::Error> {
356 if *hash == self.missing {
357 return self.inner.get_change(&Hash::of(b"intentionally absent"));
358 }
359 let mut change = self.inner.get_change(hash)?;
360 if *hash == self.corrupt {
361 change.hashed.header.message.push_str(" tampered");
362 }
363 Ok(change)
364 }
365 fn get_contents<F>(
366 &self,
367 hash_fn: F,

Calls

no outgoing calls

Tested by

no test coverage detected