Unverified Commit 7df71c13 authored by Liu-Cheng Xu's avatar Liu-Cheng Xu Committed by GitHub
Browse files

Conpanion for Substrate#7127 (#1865)

* Conpanion for Substrate#7127

* Use sp_session::OneSessionHandler

* .

* Fix pallet_session::OneSessionHandler

* OneSessionHandler is in frame_support now

* "Update Substrate"

Co-authored-by: parity-processbot <>
parent aba42e4a
Pipeline #122782 canceled with stages
in 16 minutes and 14 seconds
This diff is collapsed.
......@@ -31,7 +31,7 @@ use primitives::v1::{BlockNumber, ValidatorId, AssignmentId};
use sp_runtime::{Perquintill, Perbill, FixedPointNumber};
use frame_system::limits;
use frame_support::{
parameter_types, traits::{Currency},
parameter_types, traits::{Currency, OneSessionHandler},
weights::{Weight, constants::WEIGHT_PER_SECOND, DispatchClass},
};
use pallet_transaction_payment::{TargetedFeeAdjustment, Multiplier};
......@@ -136,8 +136,7 @@ impl<T> sp_runtime::BoundToRuntimeAppPublic for ParachainSessionKeyPlaceholder<T
type Public = ValidatorId;
}
impl<T: pallet_session::Config>
pallet_session::OneSessionHandler<T::AccountId> for ParachainSessionKeyPlaceholder<T>
impl<T: pallet_session::Config> OneSessionHandler<T::AccountId> for ParachainSessionKeyPlaceholder<T>
{
type Key = ValidatorId;
......@@ -165,8 +164,7 @@ impl<T> sp_runtime::BoundToRuntimeAppPublic for AssignmentSessionKeyPlaceholder<
type Public = AssignmentId;
}
impl<T: pallet_session::Config>
pallet_session::OneSessionHandler<T::AccountId> for AssignmentSessionKeyPlaceholder<T>
impl<T: pallet_session::Config> OneSessionHandler<T::AccountId> for AssignmentSessionKeyPlaceholder<T>
{
type Key = AssignmentId;
......
......@@ -271,7 +271,7 @@ mod tests {
};
use keyring::Sr25519Keyring;
use runtime_parachains::{initializer, configuration, inclusion, session_info, scheduler, dmp, ump, hrmp};
use pallet_session::OneSessionHandler;
use frame_support::traits::OneSessionHandler;
impl_outer_origin! {
pub enum Origin for Test {
......
......@@ -626,6 +626,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type ValidatorSet = Historical;
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type UnsignedPriority = ImOnlineUnsignedPriority;
......
......@@ -23,7 +23,7 @@ use sp_std::prelude::*;
use frame_support::weights::Weight;
use primitives::v1::ValidatorId;
use frame_support::{
decl_storage, decl_module, decl_error, traits::Randomness,
decl_storage, decl_module, decl_error, traits::{OneSessionHandler, Randomness},
};
use parity_scale_codec::{Encode, Decode};
use crate::{
......@@ -237,7 +237,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = ValidatorId;
}
impl<T: pallet_session::Config + Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
impl<T: pallet_session::Config + Config> OneSessionHandler<T::AccountId> for Module<T> {
type Key = ValidatorId;
fn on_genesis_session<'a, I: 'a>(_validators: I)
......
......@@ -22,7 +22,7 @@
use primitives::v1::{AssignmentId, AuthorityDiscoveryId, SessionIndex, SessionInfo};
use frame_support::{
decl_storage, decl_module, decl_error,
weights::Weight,
traits::OneSessionHandler, weights::Weight,
};
use crate::{configuration, paras, scheduler};
use sp_std::vec::Vec;
......@@ -141,7 +141,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AssignmentId;
}
impl<T: pallet_session::Config + Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
impl<T: pallet_session::Config + Config> OneSessionHandler<T::AccountId> for Module<T> {
type Key = AssignmentId;
fn on_genesis_session<'a, I: 'a>(_validators: I)
......
......@@ -671,6 +671,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type ValidatorSet = Historical;
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
......
......@@ -326,6 +326,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type ValidatorSet = Historical;
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type UnsignedPriority = StakingUnsignedPriority;
......
......@@ -406,6 +406,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type ValidatorSet = Historical;
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type UnsignedPriority = StakingUnsignedPriority;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment