Unverified Commit f4774a5d authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Adds deregister_validators call for propose-parachain (#2615)

parent a1e36ecc
Pipeline #128130 canceled with stages
in 24 minutes and 27 seconds
...@@ -103,7 +103,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { ...@@ -103,7 +103,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("rococo"), spec_name: create_runtime_str!("rococo"),
impl_name: create_runtime_str!("parity-rococo-v1-1"), impl_name: create_runtime_str!("parity-rococo-v1-1"),
authoring_version: 0, authoring_version: 0,
spec_version: 210, spec_version: 215,
impl_version: 0, impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))] #[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
......
...@@ -107,6 +107,8 @@ decl_event! { ...@@ -107,6 +107,8 @@ decl_event! {
ParachainRegistered(ParaId), ParachainRegistered(ParaId),
/// New validators were added to the set. /// New validators were added to the set.
ValidatorsRegistered(Vec<ValidatorId>), ValidatorsRegistered(Vec<ValidatorId>),
/// Validators were removed from the set.
ValidatorsDeregistered(Vec<ValidatorId>),
} }
} }
...@@ -296,6 +298,8 @@ decl_module! { ...@@ -296,6 +298,8 @@ decl_module! {
} }
/// Add new validators to the set. /// Add new validators to the set.
///
/// The new validators will be active from current session + 2.
#[weight = 100_000] #[weight = 100_000]
fn register_validators( fn register_validators(
origin, origin,
...@@ -307,6 +311,21 @@ decl_module! { ...@@ -307,6 +311,21 @@ decl_module! {
Self::deposit_event(RawEvent::ValidatorsRegistered(validators)); Self::deposit_event(RawEvent::ValidatorsRegistered(validators));
} }
/// Remove validators from the set.
///
/// The removed validators will be deactivated from current session + 2.
#[weight = 100_000]
fn deregister_validators(
origin,
validators: Vec<T::ValidatorId>,
) {
T::PriviledgedOrigin::ensure_origin(origin)?;
validators.clone().into_iter().for_each(|v| ValidatorsToRetire::<T>::append(v));
Self::deposit_event(RawEvent::ValidatorsDeregistered(validators));
}
} }
} }
......
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