From 15fc24d6c618e9eddd91747d2997592b92569192 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 07:45:45 +0200 Subject: [PATCH] BP-3 2: pin the deferral constants Co-Authored-By: Claude Sonnet 5 --- crates/huginn-daemon/src/bodies.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/huginn-daemon/src/bodies.rs b/crates/huginn-daemon/src/bodies.rs index 1ec113e..f58d05c 100644 --- a/crates/huginn-daemon/src/bodies.rs +++ b/crates/huginn-daemon/src/bodies.rs @@ -156,6 +156,16 @@ mod tests { use super::*; use cultnet_rs::pack_content; + /// The three numbers a client author is told, spelled out: a chunk of + /// 256 KiB, a largest deferred body of 64 MiB, a budget of 256 MiB that + /// holds at least one whole body. + #[test] + fn the_deferral_constants_are_the_documented_numbers() { + assert_eq!(DEFERRED_CHUNK_BYTES, 262_144); + assert_eq!(MAX_DEFERRED_BODY_BYTES, 67_108_864); + assert_eq!(DEFERRED_BUDGET_BYTES, 268_435_456); + } + fn at(seconds: i64) -> DateTime { DateTime::from_timestamp(1_800_000_000 + seconds, 0).unwrap() }