From ce8ccdc68f5b0cc52b380177665ee07505c5bfb5 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 22:56:25 +0000 Subject: federation: the tests' harness builds a federation's root `Spec::root`: the root whose first version a spec spells out, built in one place for the tests of the attacks, of the store read from a document, and the properties. --- src/federation/harness.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/federation/harness.rs') diff --git a/src/federation/harness.rs b/src/federation/harness.rs index 80328dd..42ee870 100644 --- a/src/federation/harness.rs +++ b/src/federation/harness.rs @@ -248,4 +248,14 @@ impl Spec { pub(crate) fn hash(&self) -> Id { Id::of(&self.json().bytes()) } + + /// The root of a federation whose first version this is. + pub(crate) fn root(&self) -> Vec { + event::Checkpoint { + at: Vec::new(), + keeps: Vec::new(), + version: super::version::Version::read(&self.json()).expect("a version"), + } + .bytes() + } } -- cgit v1.3.1