This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
103103 spec_name : create_runtime_str ! ( "rococo" ) ,
104104 impl_name : create_runtime_str ! ( "parity-rococo-v1-1" ) ,
105105 authoring_version : 0 ,
106- spec_version : 210 ,
106+ spec_version : 215 ,
107107 impl_version : 0 ,
108108 #[ cfg( not( feature = "disable-runtime-api" ) ) ]
109109 apis : RUNTIME_API_VERSIONS ,
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ decl_event! {
107107 ParachainRegistered ( ParaId ) ,
108108 /// New validators were added to the set.
109109 ValidatorsRegistered ( Vec <ValidatorId >) ,
110+ /// Validators were removed from the set.
111+ ValidatorsDeregistered ( Vec <ValidatorId >) ,
110112 }
111113}
112114
@@ -296,6 +298,8 @@ decl_module! {
296298 }
297299
298300 /// Add new validators to the set.
301+ ///
302+ /// The new validators will be active from current session + 2.
299303 #[ weight = 100_000 ]
300304 fn register_validators(
301305 origin,
@@ -307,6 +311,21 @@ decl_module! {
307311
308312 Self :: deposit_event( RawEvent :: ValidatorsRegistered ( validators) ) ;
309313 }
314+
315+ /// Remove validators from the set.
316+ ///
317+ /// The removed validators will be deactivated from current session + 2.
318+ #[ weight = 100_000 ]
319+ fn deregister_validators(
320+ origin,
321+ validators: Vec <T :: ValidatorId >,
322+ ) {
323+ T :: PriviledgedOrigin :: ensure_origin( origin) ?;
324+
325+ validators. clone( ) . into_iter( ) . for_each( |v| ValidatorsToRetire :: <T >:: append( v) ) ;
326+
327+ Self :: deposit_event( RawEvent :: ValidatorsDeregistered ( validators) ) ;
328+ }
310329 }
311330}
312331
You can’t perform that action at this time.
0 commit comments