diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/federation/vectors.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/federation/vectors.rs b/src/federation/vectors.rs index a474677..10ce679 100644 --- a/src/federation/vectors.rs +++ b/src/federation/vectors.rs @@ -144,3 +144,44 @@ fn events_at_federation_1s_sizes_and_just_past_them() { let largest = Json::Int(super::jcs::LARGEST_INTEGER); assert!(Event::read(&tv.write(&[dep()], "home/tv/n", largest)).is_some()); } + +/// The changes founding the swarm of `first`'s root, and those founding the fork whose +/// root is `FORK_ROOT`, keeping tv's write: printed, each by its hash and its bytes, to be +/// fixed as vectors (`cargo test --features federation changes_to_fix -- --ignored +/// --nocapture`). Automerge encodes them, so no script apart computes them. +#[test] +#[ignore] +fn changes_to_fix() { + use super::fold::Federation; + use super::store::Fold; + let root = Checkpoint { + at: Vec::new(), + keeps: Vec::new(), + version: Version::read(&first().json()).expect("a version"), + } + .bytes(); + let founding = [ + ( + "root", + crate::document::events::founding(Federation::NAME, &root, &[]), + ), + ( + "fork", + crate::document::events::founding( + Federation::NAME, + FORK_ROOT.as_bytes(), + &[WRITE.as_bytes().to_vec()], + ), + ), + ]; + for (name, changes) in founding { + for change in changes { + let bytes: String = change + .raw_bytes() + .iter() + .map(|byte| format!("{byte:02x}")) + .collect(); + println!("{name} {} {bytes}", change.hash()); + } + } +} |
