From 1bbb45bfe7c9c437373aefa08a6a985bc260f520 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 16:21:09 +0000 Subject: events: the store's summary names the node's party, and whether it votes for it `GET /events` names the party the node is of (`party`, `--store-party`) and whether it votes for it by itself (`votesByItself`, `--store-vote-key`), and so casts a vote by hand (`POST /admin/events/vote`): what a page offering votes through the node asks. --- src/api/events.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/api') diff --git a/src/api/events.rs b/src/api/events.rs index b388acc..3017c25 100644 --- a/src/api/events.rs +++ b/src/api/events.rs @@ -77,15 +77,19 @@ fn why(refusal: &Refusal) -> String { } } -/// `GET /events`: the store's ID, its checkpoint's, its heads, and how many events it -/// took after its checkpoint. +/// `GET /events`: the store's ID, its checkpoint's, its heads, how many events it took +/// after its checkpoint, the node's party, and whether the node votes for it by itself. async fn summary(State(state): State) -> Response { + let party = state.holding.party().map(str::to_owned); + let votes = state.holding.votes_by_itself(); with_store(&state, |store| { json!({ "store": store.id().to_string(), "checkpoint": Id::of(store.checkpoint()).to_string(), "heads": ids(store.heads()), "taken": store.taken().len(), + "party": party, + "votesByItself": votes, }) }) } -- cgit v1.3.1