lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit 58ed2c5383efeb62a537a595712e19b31255d1b7
parent b55e767bf344af61652b3001e6430a1ab032ba75
Author: triesap <tyson@radroots.org>
Date:   Mon, 13 Jul 2026 02:05:29 +0000

event-index: rename checkpoint type

- rename the public event-index checkpoint model
- update DTO roots and descriptor export names
- refresh checkpoint unit tests for the final symbol
- remove the mechanical double-index public name

Diffstat:
Mcrates/event_index/src/checkpoint.rs | 10+++++-----
Mcrates/event_index/src/dto.rs | 18+++++++-----------
Mcrates/event_index/src/lib.rs | 2+-
3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/crates/event_index/src/checkpoint.rs b/crates/event_index/src/checkpoint.rs @@ -19,7 +19,7 @@ pub struct RadrootsEventIndexShardCheckpoint { #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] -pub struct RadrootsEventIndexIndexCheckpoint { +pub struct RadrootsEventIndexCheckpoint { #[cfg_attr( feature = "serde", serde(deserialize_with = "crate::serde_ext::epoch_seconds::de") @@ -28,7 +28,7 @@ pub struct RadrootsEventIndexIndexCheckpoint { pub shards: Vec<RadrootsEventIndexShardCheckpoint>, } -impl RadrootsEventIndexIndexCheckpoint { +impl RadrootsEventIndexCheckpoint { pub fn get( &self, id: &RadrootsEventIndexShardId, @@ -46,7 +46,7 @@ impl RadrootsEventIndexIndexCheckpoint { #[cfg(test)] mod tests { - use super::{RadrootsEventIndexIndexCheckpoint, RadrootsEventIndexShardCheckpoint}; + use super::{RadrootsEventIndexCheckpoint, RadrootsEventIndexShardCheckpoint}; use crate::types::RadrootsEventIndexShardId; #[cfg(not(feature = "std"))] use alloc::{string::String, vec, vec::Vec}; @@ -68,7 +68,7 @@ mod tests { #[test] fn get_returns_none_for_unknown_shard() { - let cp = RadrootsEventIndexIndexCheckpoint { + let cp = RadrootsEventIndexCheckpoint { generated_at: 1, shards: vec![checkpoint("us-1", 10, Some("a"))], }; @@ -78,7 +78,7 @@ mod tests { #[test] fn upsert_inserts_and_updates_shards() { - let mut cp = RadrootsEventIndexIndexCheckpoint { + let mut cp = RadrootsEventIndexCheckpoint { generated_at: 2, shards: Vec::new(), }; diff --git a/crates/event_index/src/dto.rs b/crates/event_index/src/dto.rs @@ -4,7 +4,7 @@ use dto_bindgen_core::{ }; use crate::{ - checkpoint::{RadrootsEventIndexIndexCheckpoint, RadrootsEventIndexShardCheckpoint}, + checkpoint::{RadrootsEventIndexCheckpoint, RadrootsEventIndexShardCheckpoint}, manifest::{RadrootsEventIndexManifest, RadrootsEventIndexShardMetadata}, types::RadrootsEventIndexIdRange, }; @@ -15,7 +15,7 @@ pub fn dto_roots() -> [RootDescriptor; 5] { RootDescriptor::new::<RadrootsEventIndexShardMetadata>(), RootDescriptor::new::<RadrootsEventIndexManifest>(), RootDescriptor::new::<RadrootsEventIndexShardCheckpoint>(), - RootDescriptor::new::<RadrootsEventIndexIndexCheckpoint>(), + RootDescriptor::new::<RadrootsEventIndexCheckpoint>(), ] } @@ -62,11 +62,11 @@ impl Dto for RadrootsEventIndexShardCheckpoint { } } -impl Dto for RadrootsEventIndexIndexCheckpoint { +impl Dto for RadrootsEventIndexCheckpoint { fn describe(ctx: &mut DescribeCtx) -> TypeRef { let def = StructDef::new( - "RadrootsEventIndexIndexCheckpoint", - "RadrootsEventIndexIndexCheckpoint", + "RadrootsEventIndexCheckpoint", + "RadrootsEventIndexCheckpoint", span("crates/event_index/src/checkpoint.rs", 24), ) .with_field(field( @@ -83,11 +83,7 @@ impl Dto for RadrootsEventIndexIndexCheckpoint { "crates/event_index/src/checkpoint.rs", 31, )); - register( - ctx, - "RadrootsEventIndexIndexCheckpoint", - TypeDef::Struct(def), - ) + register(ctx, "RadrootsEventIndexCheckpoint", TypeDef::Struct(def)) } } @@ -150,7 +146,7 @@ mod tests { fn custom_epoch_second_fields_render_as_numbers() { let registry = build_registry(dto_roots()); let shard_checkpoint = find_struct(&registry, "RadrootsEventIndexShardCheckpoint"); - let index_checkpoint = find_struct(&registry, "RadrootsEventIndexIndexCheckpoint"); + let index_checkpoint = find_struct(&registry, "RadrootsEventIndexCheckpoint"); assert_eq!( find_field(shard_checkpoint, "last_created_at").ty, diff --git a/crates/event_index/src/lib.rs b/crates/event_index/src/lib.rs @@ -9,7 +9,7 @@ pub mod manifest; pub mod serde_ext; pub mod types; -pub use checkpoint::{RadrootsEventIndexIndexCheckpoint, RadrootsEventIndexShardCheckpoint}; +pub use checkpoint::{RadrootsEventIndexCheckpoint, RadrootsEventIndexShardCheckpoint}; pub use manifest::{ RadrootsEventIndexManifest, RadrootsEventIndexManifestError, RadrootsEventIndexShardMetadata, validate_manifest,