From 5aa649bcb366ed6863732dac68ce081bacdbe4a8 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 21:36:52 +0000 Subject: continuum-party status: IDs and hashes whole Now that `status` gives each thing a line of its own, there's no line to keep short: the store's ID, its checkpoint's and the version's hash are written whole, as node IDs and proposals' hashes were already; so are the proposals' hashes in what a vote's guard says. Keys still go by their fingerprints. --- src/federation/party.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/federation/party.rs') diff --git a/src/federation/party.rs b/src/federation/party.rs index a1eb6a0..29d9cb8 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -1604,14 +1604,13 @@ fn consistent(counts: &JsonValue, current: &Version, record: &Record) -> Result< /// How the party's votes on `current` that `counts` shows differ from `record`'s: those the /// node shows that the record lacks, and those the record holds that the node doesn't show; -/// each as `true on 8d02…`. +/// each as `` `true` on ``. fn unrecorded( counts: &JsonValue, current: &Version, record: &Record, ) -> (Vec, Vec) { let party = record.party.as_str(); - let short = |hash: &str| format!("{}…", hash.get(..12).unwrap_or(hash)); let mut shown = Vec::new(); for (hash, ballot) in counts["proposals"].as_object().into_iter().flatten() { for (what, yes) in [("yes", true), ("no", false)] { @@ -1628,7 +1627,7 @@ fn unrecorded( .into_iter() .map(|(proposal, yes)| (proposal.to_string(), yes)) .collect(); - let spelled = |(hash, yes): &(String, bool)| format!("`{yes}` on {}", short(hash)); + let spelled = |(hash, yes): &(String, bool)| format!("`{yes}` on {hash}"); ( shown .iter() @@ -1828,16 +1827,12 @@ async fn status(node: &Node, options: &Options, party: Option<&str>) -> Result<( let summary = node.get("/events").await?; let counts = node.counts().await?; let current = current(&counts)?; - let short = |id: &str| match id.get(..12) { - Some(start) if id.len() > 12 => format!("{start}…"), - _ => id.to_owned(), - }; let text = |value: &JsonValue| value.as_str().unwrap_or_default().to_owned(); let plural = |n: usize, one: &str, many: &str| format!("{n} {}", if n == 1 { one } else { many }); let heads = summary["heads"].as_array().map_or(0, Vec::len); - println!("store {}", short(&text(&summary["store"]))); - println!(" checkpoint {}", short(&text(&summary["checkpoint"]))); + println!("store {}", text(&summary["store"])); + println!(" checkpoint {}", text(&summary["checkpoint"])); println!( " {}, {} taken after the checkpoint", plural(heads, "head", "heads"), @@ -1848,11 +1843,7 @@ async fn status(node: &Node, options: &Options, party: Option<&str>) -> Result<( ) ); let needed = (2 * current.parties.len()).div_ceil(3); - println!( - "version {} ({})", - current.number, - short(¤t.hash.to_string()) - ); + println!("version {} ({})", current.number, current.hash); println!( " federation {}, {}", counts["version"]["version"]["federation"], current.revision -- cgit v1.3.1