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/properties.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/federation/properties.rs') diff --git a/src/federation/properties.rs b/src/federation/properties.rs index 082fcac..36724ff 100644 --- a/src/federation/properties.rs +++ b/src/federation/properties.rs @@ -99,15 +99,6 @@ fn pick(rng: &mut Rng, ids: &[Id]) -> Id { } } -fn root_of(spec: &Spec) -> Vec { - Checkpoint { - at: Vec::new(), - keeps: Vec::new(), - version: Version::read(&spec.json()).expect("a version"), - } - .bytes() -} - fn generate(rng: &mut Rng, kind: Kind) -> History { let count = rng.between(3, 5); let parties: Vec = (0..count) @@ -116,7 +107,7 @@ fn generate(rng: &mut Rng, kind: Kind) -> History { let adversary = count - 1; let refs: Vec<&Party> = parties.iter().collect(); let first = Spec::first(&refs, &[("names/{party}", harness::str("{party}"))]); - let root = root_of(&first); + let root = first.root(); let root_id = Id::of(&root); let mut world: Store = Store::new(root.clone(), Vec::new()).expect("a root"); let mut specs: BTreeMap = BTreeMap::from([(first.hash(), first)]); -- cgit v1.3.1