aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/party.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/federation/party.rs')
-rw-r--r--src/federation/party.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs
index 148bd20..a12dc7f 100644
--- a/src/federation/party.rs
+++ b/src/federation/party.rs
@@ -53,6 +53,7 @@ use super::client::{self, Record};
use super::event::{self, Does, Event, Signed};
use super::fold::Federation;
use super::jcs::Json;
+use super::judge;
use super::keys::{self, Key};
use super::revision::{FEATURES, Revision};
use super::store::Id;
@@ -175,6 +176,10 @@ fn command() -> Command {
.about("What the node finds of the fork whose root a file holds")
.arg(id("file")),
)
+ .subcommand(Command::new("judge").about(
+ "What a store makes of the histories its input spells, in a format every release \
+ keeps (federation-tests.md, Against released revisions)",
+ ))
.subcommand(Command::new("proposals").about(
"The proposals on the current version: whether each passed or is dead, who voted \
what, and what it changes",
@@ -277,6 +282,13 @@ pub(crate) async fn main() -> Result<()> {
}
return out(&super::fork::root_file(&root, &[]));
}
+ if name == "judge" {
+ let mut input = String::new();
+ std::io::Read::read_to_string(&mut std::io::stdin(), &mut input)?;
+ let histories = judge::read(&input).map_err(|why| anyhow!(why))?;
+ print!("{}", judge::judge(&histories));
+ return Ok(());
+ }
let node = Node::new(&options)?;
if name == "proposals" {
return proposals(&node).await;