Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor state machine es clean up items #5654

Merged
merged 3 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ use super::{
state_machine::StateMachine,
};

pub trait IntoResult {
type Ok;
type Err;

fn into_result(self) -> Result<Self::Ok, Self::Err>;
}

impl<A, B> IntoResult for Result<A, B> {
type Ok = A;
type Err = B;
fn into_result(self) -> Result<A, B> {
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
Expand Down