Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/core/src/atom/molecule.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use super::{deterministic_molecule_uuid, now_nanos, MergeConflict};
use super::{deterministic_molecule_uuid, now_nanos, KeyMetadata, MergeConflict};
use crate::atom::provenance::Provenance;
use crate::security::Ed25519KeyPair;

Expand All @@ -20,7 +20,7 @@ pub struct Molecule {
#[serde(default)]
version: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
key_metadata: Option<super::KeyMetadata>,
key_metadata: Option<KeyMetadata>,
/// Base64-encoded public key of the writer who last signed this molecule.
#[serde(default)]
writer_pubkey: String,
Expand Down Expand Up @@ -117,13 +117,13 @@ impl Molecule {
}

/// Sets per-key metadata on the molecule.
pub fn set_key_metadata(&mut self, meta: super::KeyMetadata) {
pub fn set_key_metadata(&mut self, meta: KeyMetadata) {
self.key_metadata = Some(meta);
}

/// Returns the per-key metadata, if any.
#[must_use]
pub fn get_key_metadata(&self) -> Option<&super::KeyMetadata> {
pub fn get_key_metadata(&self) -> Option<&KeyMetadata> {
self.key_metadata.as_ref()
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/atom/molecule_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, MergeConflict};
use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, KeyMetadata, MergeConflict};
use crate::security::Ed25519KeyPair;

/// A hash-based collection of atom references stored in a HashMap.
Expand All @@ -16,7 +16,7 @@ pub struct MoleculeHash {
#[serde(default)]
version: u64,
#[serde(default)]
key_metadata: HashMap<String, super::KeyMetadata>,
key_metadata: HashMap<String, KeyMetadata>,
}

impl MoleculeHash {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/atom/molecule_hash_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};

use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, MergeConflict};
use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, KeyMetadata, MergeConflict};

/// A hash-range-based collection of atom references stored in a nested HashMap<BTreeMap> structure.
///
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct MoleculeHashRange {
/// Per-key metadata organized by hash and range values
/// Structure: HashMap<hash_value, BTreeMap<range_value, KeyMetadata>>
#[serde(default)]
key_metadata: HashMap<String, BTreeMap<String, crate::atom::KeyMetadata>>,
key_metadata: HashMap<String, BTreeMap<String, KeyMetadata>>,
}

impl MoleculeHashRange {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/atom/molecule_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, MergeConflict};
use super::{deterministic_molecule_uuid, now_nanos, AtomEntry, KeyMetadata, MergeConflict};
use crate::security::Ed25519KeyPair;

/// A range-based collection of atom references stored in a BTreeMap.
Expand All @@ -15,7 +15,7 @@ pub struct MoleculeRange {
#[serde(default)]
version: u64,
#[serde(default)]
key_metadata: BTreeMap<String, super::KeyMetadata>,
key_metadata: BTreeMap<String, KeyMetadata>,
}

impl MoleculeRange {
Expand Down
Loading