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

Method attest_path

atomic-repository/src/changestore/attestation.rs:28–36  ·  view source on GitHub ↗

Get the filesystem path for an attestation with the given hash. Attestations use the same two-level directory structure as changes but with the `.attest` extension. # Example ```rust,ignore let hash = Hash::of(b"test"); let path = store.attest_path(&hash); // e.g., ".atomic/changes/AB/ABCDEF1234567890....attest" ```

(&self, hash: &Hash)

Source from the content-addressed store, hash-verified

26 /// // e.g., ".atomic/changes/AB/ABCDEF1234567890....attest"
27 /// ```
28 pub fn attest_path(&self, hash: &Hash) -> PathBuf {
29 let hash_str = hash.to_base32();
30 let (prefix, _) = hash_str.split_at(HASH_PREFIX_LEN.min(hash_str.len()));
31 self.changes_dir.join(prefix).join(format!(
32 "{}.{}",
33 hash_str,
34 atomic_core::change::ATTESTATION_EXTENSION
35 ))
36 }
37
38 /// Check if an attestation with the given hash exists on disk.
39 pub fn has_attestation(&self, hash: &Hash) -> bool {

Callers 3

has_attestationMethod · 0.80
save_attestationMethod · 0.80
load_attestationMethod · 0.80

Calls 2

to_base32Method · 0.45
lenMethod · 0.45

Tested by

no test coverage detected