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

Method check_hash

atomic-core/src/change/verified.rs:55–63  ·  view source on GitHub ↗

Check the requested identity even when a store returned a valid witness for some other change.

(&self, expected: &Hash)

Source from the content-addressed store, hash-verified

53 /// Check the requested identity even when a store returned a valid witness
54 /// for some other change.
55 pub fn check_hash(&self, expected: &Hash) -> Result<(), ChangeError> {
56 if self.hash != *expected {
57 return Err(ChangeError::Invalid(format!(
58 "change hash mismatch: expected {expected:?}, computed {:?}",
59 self.hash
60 )));
61 }
62 Ok(())
63 }
64
65 /// Whether these bytes exactly match the previously verified source,
66 /// including unhashed notes/signatures. A change in any byte requires a

Calls

no outgoing calls