From 0e8c4de4b506638f0d69b6601ee0920660de0b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 5 Jul 2019 15:41:51 +0200 Subject: [PATCH] Implement `SelectInitialValidators` for `()` (#3037) This is quite more idiomatic substrate :D --- substrate/srml/session/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/substrate/srml/session/src/lib.rs b/substrate/srml/session/src/lib.rs index 1451b62060..981cc930eb 100644 --- a/substrate/srml/session/src/lib.rs +++ b/substrate/srml/session/src/lib.rs @@ -220,9 +220,7 @@ pub trait SelectInitialValidators { fn select_initial_validators() -> Option>; } -/// Implementation of `SelectInitialValidators` that does nothing. -pub struct AllValidators; -impl SelectInitialValidators for AllValidators { +impl SelectInitialValidators for () { fn select_initial_validators() -> Option> { None } @@ -565,7 +563,7 @@ mod tests { type SessionHandler = TestSessionHandler; type Keys = UintAuthorityId; type Event = (); - type SelectInitialValidators = AllValidators; + type SelectInitialValidators = (); } type System = system::Module;