From b0f0e1a9edb08b324df2ec5e97d15e7089349fdb Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Nov 2026 12:32:13 +0000 Subject: 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. --- src/federation/party.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/federation/party.rs') 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::("file").expect("required"))?; let current = node.current().await?; signer.named_by(¤t)?; - let proposed = Version::read(&version) - .and_then(|proposed| proposed.changes_validly(Some(¤t)).map(|()| proposed)) - .map_err(|why| { - anyhow!("not a version changing version {}: {why}", current.number) - })?; + let proposed = client::backable(¤t, &version) + .map_err(|why| anyhow!("not a version a party may back: {why}"))?; sign( &node, &signer, -- cgit v1.3.1