aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/party.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-18 12:32:13 +0000
committertv <tv@krebsco.de>2026-11-18 13:35:01 +0100
commitb0f0e1a9edb08b324df2ec5e97d15e7089349fdb (patch)
tree19446d3a9f304ded779b3a48ab4447dc96511608 /src/federation/party.rs
parent13d96ce6ecd386ddd39b803ecb52a8557476f8fa (diff)
continuum-party: proposes only what a party may back
One check (`client::backable`) decides what a party's client proposes and what it votes `true` on: a version, changing the current one as a version must, whose checkpoint, where it names one, names none of the heads of the current version's checkpoint, as a version naming those again is never written. A proposal nobody may back is refused before it is signed, saying why.
Diffstat (limited to 'src/federation/party.rs')
-rw-r--r--src/federation/party.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs
index 788bde9..60b7e18 100644
--- a/src/federation/party.rs
+++ b/src/federation/party.rs
@@ -16,9 +16,9 @@
//! changed; with `--set`, set whole. One left empty is written with `--force` only;
//! * `next`: the version after the current one, to change and propose: the current one
//! numbered on, naming its hash, without its checkpoint (JSON), to standard output;
-//! * `propose FILE`: proposes the version `FILE` holds (JSON), where it changes the
-//! current one as a version must (`Version::changes_validly`), and says the proposal's
-//! hash; with `--yes`, votes `true` on it too, as `vote` does;
+//! * `propose FILE`: proposes the version `FILE` holds (JSON), where a party may back it
+//! (`client::backable`), and says the proposal's hash; with `--yes`, votes `true` on it
+//! too, as `vote` does;
//! * `vote PROPOSAL yes|no`: votes on the proposal of hash `PROPOSAL` on the current
//! version, by the record; with `--through`, through the node that votes for the
//! party by itself and keeps its record, as such a party votes by hand;
@@ -425,11 +425,8 @@ pub(crate) async fn main() -> Result<()> {
let version = version_in(sub.get_one::<String>("file").expect("required"))?;
let current = node.current().await?;
signer.named_by(&current)?;
- let proposed = Version::read(&version)
- .and_then(|proposed| proposed.changes_validly(Some(&current)).map(|()| proposed))
- .map_err(|why| {
- anyhow!("not a version changing version {}: {why}", current.number)
- })?;
+ let proposed = client::backable(&current, &version)
+ .map_err(|why| anyhow!("not a version a party may back: {why}"))?;
sign(
&node,
&signer,