aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/party/status.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/federation/party/status.rs')
-rw-r--r--src/federation/party/status.rs21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/federation/party/status.rs b/src/federation/party/status.rs
index 6094a23..68953fe 100644
--- a/src/federation/party/status.rs
+++ b/src/federation/party/status.rs
@@ -1,9 +1,9 @@
//! `continuum-party status`: everything about the federation at a node but the values
-//! (`values`, `read`). The store; the node; the current version; every party's keys and
-//! nodes, when the node last heard from each and what each runs; the proposals on the
-//! current version, how they stand and what each does; what the node refused of its own;
-//! and the party the client works as: its key, its record against the node, what it signs
-//! again; with what may keep votes away.
+//! (`values`, `read`). The store, with the federation's name; the node; the current
+//! version; every party's keys and nodes, when the node last heard from each and what each
+//! runs; the proposals on the current version, how they stand and what each does; what
+//! the node refused of its own; and the party the client works as: its key, its record
+//! against the node, what it signs again; with what may keep votes away.
//!
//! As people read it, in colours on a terminal (`Paint`), which may change from release to
//! release; with `--json`, the same as one JSON object (`model`), of a format versioned by
@@ -124,6 +124,7 @@ async fn model(node: &Node, options: &Options, party: Option<&str>) -> Result<Js
"version": {
"number": current.number,
"hash": current.hash.to_string(),
+ "name": current.name,
"federation": counts["version"]["version"]["federation"],
"revision": counts["version"]["revision"],
"parties": current.parties.len(),
@@ -422,8 +423,13 @@ fn render(model: &JsonValue, paint: &Paint) -> Vec<String> {
let number = |value: &JsonValue| value.as_u64().unwrap_or_default();
let store = &model["store"];
+ // The federation's name, as its current version gives it, after the store's ID.
+ let called = match model["version"]["name"].as_str() {
+ Some(name) => format!(" ({})", paint.paint(Style::Party, name)),
+ None => String::new(),
+ };
out.push(format!(
- "{} {}",
+ "{} {}{called}",
heading("store"),
paint.paint(Style::Id, &text(&store["id"]))
));
@@ -782,6 +788,7 @@ mod tests {
"version": {
"number": 3,
"hash": "a7c2",
+ "name": "krebs",
"federation": 1,
"revision": {"named": "the base revision"},
"parties": 2,
@@ -862,7 +869,7 @@ mod tests {
lines.join("\n")
);
};
- has("store 6d1e");
+ has("store 6d1e (krebs)");
has("the node continuum:9c07 (beta)");
has(" lass's, voting for it by itself");
has("version 3 (a7c2)");