mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 17:21:08 +00:00
migrate pallet-shift-session-manager to frame v2 (#1090)
This commit is contained in:
committed by
Bastian Köcher
parent
92b3a69126
commit
68eaee1bd4
@@ -19,22 +19,33 @@
|
|||||||
|
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
|
||||||
use frame_support::{decl_module, decl_storage};
|
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
|
|
||||||
/// The module configuration trait.
|
pub use pallet::*;
|
||||||
pub trait Config: pallet_session::Config {}
|
|
||||||
|
|
||||||
decl_module! {
|
#[frame_support::pallet]
|
||||||
/// Shift session manager pallet.
|
pub mod pallet {
|
||||||
pub struct Module<T: Config> for enum Call where origin: T::Origin {}
|
use super::*;
|
||||||
}
|
use frame_support::pallet_prelude::*;
|
||||||
|
use frame_system::pallet_prelude::*;
|
||||||
|
|
||||||
decl_storage! {
|
#[pallet::config]
|
||||||
trait Store for Pallet<T: Config> as ShiftSessionManager {
|
#[pallet::disable_frame_system_supertrait_check]
|
||||||
/// Validators of first two sessions.
|
pub trait Config: pallet_session::Config {}
|
||||||
InitialValidators: Option<Vec<T::ValidatorId>>;
|
|
||||||
}
|
#[pallet::pallet]
|
||||||
|
#[pallet::generate_store(pub(super) trait Store)]
|
||||||
|
pub struct Pallet<T>(PhantomData<T>);
|
||||||
|
|
||||||
|
#[pallet::hooks]
|
||||||
|
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||||
|
|
||||||
|
#[pallet::call]
|
||||||
|
impl<T: Config> Pallet<T> {}
|
||||||
|
|
||||||
|
/// Validators of first two sessions.
|
||||||
|
#[pallet::storage]
|
||||||
|
pub(super) type InitialValidators<T: Config> = StorageValue<_, Vec<T::ValidatorId>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
|
impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user