Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
f4774a5d
Unverified
Commit
f4774a5d
authored
Mar 12, 2021
by
Bastian Köcher
Committed by
GitHub
Mar 12, 2021
Browse files
Adds deregister_validators call for propose-parachain (#2615)
parent
a1e36ecc
Pipeline
#128130
canceled with stages
in 24 minutes and 27 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
runtime/rococo/src/lib.rs
View file @
f4774a5d
...
...
@@ -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
:
21
0
,
spec_version
:
21
5
,
impl_version
:
0
,
#[cfg(not(feature
=
"disable-runtime-api"
))]
apis
:
RUNTIME_API_VERSIONS
,
...
...
runtime/rococo/src/propose_parachain.rs
View file @
f4774a5d
...
...
@@ -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
));
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment