From 506c521ad564c5e1ffd614c30646c23d15d17547 Mon Sep 17 00:00:00 2001 From: akildemir Date: Wed, 15 Nov 2023 09:28:01 +0300 Subject: [PATCH] move ShouldEndSession to sp_session --- frame/session/src/lib.rs | 7 +------ primitives/session/src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frame/session/src/lib.rs b/frame/session/src/lib.rs index d2b1c2b744674..f6b884e41c591 100644 --- a/frame/session/src/lib.rs +++ b/frame/session/src/lib.rs @@ -140,12 +140,7 @@ use sp_std::{ pub use pallet::*; pub use weights::WeightInfo; - -/// Decides whether the session should be ended. -pub trait ShouldEndSession { - /// Return `true` if the session should be ended. - fn should_end_session(now: BlockNumber) -> bool; -} +pub use sp_session::ShouldEndSession; /// Ends the session after a fixed period of blocks. /// diff --git a/primitives/session/src/lib.rs b/primitives/session/src/lib.rs index 45395e9766f55..92badc6d2c3d9 100644 --- a/primitives/session/src/lib.rs +++ b/primitives/session/src/lib.rs @@ -52,6 +52,12 @@ sp_api::decl_runtime_apis! { /// Number of validators in a given session. pub type ValidatorCount = u32; +/// Decides whether the session should be ended. +pub trait ShouldEndSession { + /// Return `true` if the session should be ended. + fn should_end_session(now: BlockNumber) -> bool; +} + /// Proof of membership of a specific key in a given session. #[derive(Encode, Decode, Clone, Eq, PartialEq, Default, RuntimeDebug, scale_info::TypeInfo)] pub struct MembershipProof {