WIP lot V : le tampon câblé dans le serveur (migration 0010, simulation, discard-simulation), tests en cours de reprise — repris tel quel après la coupure du 02/11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-11-03 05:22:24 +01:00
co-authored by Claude Opus 5.5
parent ee37c3b4d5
commit 4b81a2e909
16 changed files with 1503 additions and 213 deletions
+11 -2
View File
@@ -1,7 +1,8 @@
//! The messages of trustinWallet (2026-10-31, lot F, ADR 0010): a box in the
//! application, in the menu, with the number of unread messages — no mail.
//!
//! A message is about a subject (an objection, a typo fix) and carries the
//! A message is about a subject (an objection, a typo fix, a ballot set aside —
//! ADR 0012) and carries the
//! gestures that subject asks of its recipient now — lift or reiterate,
//! validate or refuse — and its deadline. A message dealt with offers no
//! gesture any more. Its text is told by the interface, in the language of the
@@ -12,7 +13,7 @@
use crate::AppState;
use crate::auth::{IdentityRow, User};
use crate::error::{AppError, AppResult};
use crate::{docs, objections, typos, util};
use crate::{ballots, docs, objections, typos, util};
use axum::Json;
use axum::extract::{Path, State};
use serde_json::{Value, json};
@@ -24,6 +25,9 @@ const SHOWN: i64 = 100;
pub enum Topic {
Objection,
Typo,
/// A ballot set aside: never seen on the chain in time, refused, or its *for*
/// proven while an objection held the version back (ADR 0012).
Ballot,
}
impl Topic {
@@ -31,6 +35,7 @@ impl Topic {
match self {
Self::Objection => "objection",
Self::Typo => "typo",
Self::Ballot => "ballot",
}
}
}
@@ -168,6 +173,10 @@ async fn view(state: &AppState, me: &IdentityRow, m: &MessageRow) -> AppResult<O
Some((v, g)) => (json!({ "typo": v }), g),
None => return Ok(None),
},
"ballot" => match ballots::for_message(state, me, &m.subject_id).await? {
Some(v) => (json!({ "ballot": v }), Vec::new()),
None => return Ok(None),
},
_ => return Ok(None),
};
let mut out = json!({