diff --git a/src/api/router/snapshot_content_tests.rs b/src/api/router/snapshot_content_tests.rs index 65234d8b..2dc14015 100644 --- a/src/api/router/snapshot_content_tests.rs +++ b/src/api/router/snapshot_content_tests.rs @@ -1094,7 +1094,7 @@ async fn mst2_publication_disabled_resolve_preserves_head_body_object_map_page_a assert_eq!(chunk.file_content_id, fixture.digest); assert_eq!(chunk.chunk_index, 0); assert_eq!(end.request_item_count, 1); - assert_eq!(end.logical_bytes, CHUNK_SIZE); + assert_eq!(end.logical_bytes, u64::from(CHUNK_SIZE)); } #[tokio::test] diff --git a/src/api/router/snapshot_rooted_metadata.rs b/src/api/router/snapshot_rooted_metadata.rs index a35c7bd1..159685d4 100644 --- a/src/api/router/snapshot_rooted_metadata.rs +++ b/src/api/router/snapshot_rooted_metadata.rs @@ -8,7 +8,7 @@ use crate::{ jupiter::storage::qualified_metadata_family::RootedLookupStatus, }; -fn entry_json(entry: &Entry) -> Result { +fn entry_json(entry: &Entry) -> Result { let name = std::str::from_utf8(&entry.name).map_err(internal)?; let kind = match entry.kind { EntryKind::Regular => "regular", @@ -28,15 +28,19 @@ fn entry_json(entry: &Entry) -> Result { Ok(value) } -fn cursor_name(sid: &str, path: &str, query: &DirectoryQuery) -> Result, Response> { +fn cursor_name( + sid: &str, + path: &str, + query: &DirectoryQuery, +) -> Result, SnapshotError> { let Some(cursor) = query.cursor.as_deref() else { return Ok(None); }; let invalid = || { - mst2_error_response(SnapshotError::new( + SnapshotError::new( SnapshotErrorCode::CursorInvalid, "cursor bound to different parameters or invalid", - )) + ) }; let (payload, signature) = cursor.rsplit_once('.').ok_or_else(invalid)?; if runtime().sign_cursor(payload) != signature { diff --git a/src/jupiter/storage/qualified_metadata_family.rs b/src/jupiter/storage/qualified_metadata_family.rs index 52594dd3..024d325b 100644 --- a/src/jupiter/storage/qualified_metadata_family.rs +++ b/src/jupiter/storage/qualified_metadata_family.rs @@ -35,9 +35,7 @@ const GC_SQL: &str = include_str!("qualified_metadata_gc.sql"); #[path = "qualified_metadata_rooted.rs"] mod rooted; -pub(crate) use rooted::{ - RootedDirectoryWindow, RootedLookupBatch, RootedLookupStatus, RootedQualifiedMetadataRepository, -}; +pub(crate) use rooted::{RootedLookupStatus, RootedQualifiedMetadataRepository}; #[cfg(test)] pub(crate) use rooted::{ RootedPrepareIntent, with_rooted_reader_barriers, with_rooted_source_fact_barriers, diff --git a/src/jupiter/storage/qualified_metadata_reader.rs b/src/jupiter/storage/qualified_metadata_reader.rs index 63ccbdcd..6e28360a 100644 --- a/src/jupiter/storage/qualified_metadata_reader.rs +++ b/src/jupiter/storage/qualified_metadata_reader.rs @@ -16,6 +16,8 @@ use crate::{ }, }; +type ProofPages = Vec<([u8; 32], Vec)>; + #[derive(Debug, Clone, Copy, PartialEq, Eq)] struct Binding { generation: i64, @@ -98,7 +100,7 @@ pub(crate) struct RootedDirectoryWindow { pub entry_count: u64, pub entries: Vec, pub has_more: bool, - pub proof_pages: Vec<([u8; 32], Vec)>, + pub proof_pages: ProofPages, pub ancestors: Vec<(String, [u8; 32])>, } @@ -541,7 +543,7 @@ impl Reader<'_> { Ok(children) } - fn proofs(&self) -> Result)>, SnapshotError> { + fn proofs(&self) -> Result { let bytes: usize = self.cache.values().map(|page| page.bytes.len()).sum(); if bytes > 1_048_576 { return Err(SnapshotError::new(