From cc62cea7592ac9f2d90998830fd472135b187b7c Mon Sep 17 00:00:00 2001 From: kylezs Date: Wed, 19 Feb 2025 11:06:12 +0100 Subject: [PATCH 1/3] full word --- .../src/electoral_systems/state_machine/state_machine.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs index 0e557dee71..cd0e45fa54 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs @@ -31,10 +31,10 @@ use sp_std::fmt::Debug; /// `input_index`, an election with these election properties is going to be created automatically. /// /// ## Idle results -/// When there is no consensus, the electoral system still has to return sth in its `on_finalize` -/// function. This value is provided by the `get(&State) -> DisplayState` function. The associated -/// `DisplayState` type is an arbitrary "summary" of the current state, meant for consumers of the -/// `on_finalize` result. +/// When there is no consensus, the electoral system still has to return something in its +/// `on_finalize` function. This value is provided by the `get(&State) -> DisplayState` function. +/// The associated `DisplayState` type is an arbitrary "summary" of the current state, meant for +/// consumers of the `on_finalize` result. /// /// Note: it might be that this functionality is going to be modelled differently in the future. /// From dacd9db67cb604d4ad2d0aa973163bfe810337b7 Mon Sep 17 00:00:00 2001 From: kylezs Date: Wed, 19 Feb 2025 11:06:41 +0100 Subject: [PATCH 2/3] remove stale comment --- .../src/electoral_systems/state_machine/state_machine.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs index cd0e45fa54..fa14ef1a8f 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine.rs @@ -54,7 +54,6 @@ pub trait StateMachine: 'static { type Settings; type Output: Validate; type State: Validate; - // type DisplayState; /// To every state, this function associates a set of input indices which /// describes what kind of input(s) we want to receive next. From ab0b91700dc068088722c1a65eaa8bc2018b7fec Mon Sep 17 00:00:00 2001 From: kylezs Date: Wed, 19 Feb 2025 11:14:44 +0100 Subject: [PATCH 3/3] chore: remove unused IntoResult --- .../state_machine/state_machine_es.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine_es.rs b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine_es.rs index f041122f65..b22ec95f33 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine_es.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/state_machine/state_machine_es.rs @@ -15,21 +15,6 @@ use super::{ state_machine::StateMachine, }; -pub trait IntoResult { - type Ok; - type Err; - - fn into_result(self) -> Result; -} - -impl IntoResult for Result { - type Ok = A; - type Err = B; - fn into_result(self) -> Result { - self - } -} - /// This is an Either type, unfortunately it's more ergonomic /// to recreate this instead of using `itertools::Either`, because /// we need a special implementation of Indexed: we want the vote to