aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/events.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-18 20:12:04 +0000
committertv <tv@krebsco.de>2026-11-18 21:17:57 +0100
commit7404dcef34dbad11a5ac2a6b8a27836b01c82635 (patch)
tree9f2f55ad01130e454f6c6e9f308b459caadea6e9 /src/api/events.rs
parent657765cc512743c248d71b852b4f2e81fa124af7 (diff)
events: why no party's client backs a proposal
`GET /events/counts` gives each proposal on the current version `none`: why a party's client backs it not (`client::backable`), where it is no version as this node reads it, none changing the current one, or one naming the heads of the current one's checkpoint; else `null`. So a node shows that a proposal is none, and why, before it passes: one that passes all the same is never written, or, no version here, the node stops at its version event. The dashboard shows it with the proposal, and `continuum-party proposals` says it by the federation the client knows. Row 48's test checks what a node shows of the proposal.
Diffstat (limited to 'src/api/events.rs')
-rw-r--r--src/api/events.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/api/events.rs b/src/api/events.rs
index bd6db70..496a077 100644
--- a/src/api/events.rs
+++ b/src/api/events.rs
@@ -17,6 +17,7 @@ use serde_json::{Value as JsonValue, json};
use super::auth::AuthenticatedUser;
use super::{ApiError, error_response, store_status};
+use crate::federation::client;
use crate::federation::fold::Federation;
use crate::federation::fork;
use crate::federation::jcs::Json as Jcs;
@@ -124,7 +125,9 @@ async fn event(State(state): State<AppState>, Path(id): Path<String>) -> Respons
/// `GET /events/counts`: what counts, as the store reads now: the current version, each
/// party's keys and nodes, the values at places, the members, and the proposals on the
/// current version, each with the events proposing it, the votes on it, the parties
-/// voting `true` and `false`, and whether it passed and whether it is dead.
+/// voting `true` and `false`, whether it passed and whether it is dead, and why a party's
+/// client backs it not, where it is no version that can be written on the current one
+/// (`client::backable`).
async fn counts(State(state): State<AppState>) -> Response {
with_store(&state, |store| {
let read = store.state();
@@ -152,6 +155,9 @@ async fn counts(State(state): State<AppState>) -> Response {
.into_iter()
.map(|(hash, ballot)| {
let tally = read.tally(current, &hash);
+ let none = read
+ .proposal(&hash)
+ .and_then(|proposed| client::backable(current, proposed).err());
(
hash.to_string(),
json!({
@@ -161,6 +167,7 @@ async fn counts(State(state): State<AppState>) -> Response {
"no": tally.no,
"passed": tally.passed,
"dead": tally.dead,
+ "none": none,
}),
)
})