mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Adds deregister_validators call for propose-parachain (#2615)
This commit is contained in:
@@ -103,7 +103,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("rococo"),
|
||||
impl_name: create_runtime_str!("parity-rococo-v1-1"),
|
||||
authoring_version: 0,
|
||||
spec_version: 210,
|
||||
spec_version: 215,
|
||||
impl_version: 0,
|
||||
#[cfg(not(feature = "disable-runtime-api"))]
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
|
||||
@@ -107,6 +107,8 @@ decl_event! {
|
||||
ParachainRegistered(ParaId),
|
||||
/// New validators were added to the set.
|
||||
ValidatorsRegistered(Vec<ValidatorId>),
|
||||
/// Validators were removed from the set.
|
||||
ValidatorsDeregistered(Vec<ValidatorId>),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +298,8 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Add new validators to the set.
|
||||
///
|
||||
/// The new validators will be active from current session + 2.
|
||||
#[weight = 100_000]
|
||||
fn register_validators(
|
||||
origin,
|
||||
@@ -307,6 +311,21 @@ decl_module! {
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user