@@ -303,7 +303,7 @@ use frame_support::{
303
303
} ;
304
304
use pallet_session:: historical;
305
305
use sp_runtime:: {
306
- Perbill , PerU16 , PerThing , RuntimeDebug , DispatchError ,
306
+ Percent , Perbill , PerU16 , PerThing , RuntimeDebug , DispatchError ,
307
307
curve:: PiecewiseLinear ,
308
308
traits:: {
309
309
Convert , Zero , StaticLookup , CheckedSub , Saturating , SaturatedConversion , AtLeast32Bit ,
@@ -1794,6 +1794,34 @@ decl_module! {
1794
1794
ValidatorCount :: put( new) ;
1795
1795
}
1796
1796
1797
+ /// Increments the ideal number of validators.
1798
+ ///
1799
+ /// The dispatch origin must be Root.
1800
+ ///
1801
+ /// # <weight>
1802
+ /// Base Weight: 1.717 µs
1803
+ /// Read/Write: Validator Count
1804
+ /// # </weight>
1805
+ #[ weight = 2 * WEIGHT_PER_MICROS + T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ]
1806
+ fn increase_validator_count( origin, #[ compact] additional: u32 ) {
1807
+ ensure_root( origin) ?;
1808
+ ValidatorCount :: mutate( |n| * n += additional) ;
1809
+ }
1810
+
1811
+ /// Scale up the ideal number of validators by a factor.
1812
+ ///
1813
+ /// The dispatch origin must be Root.
1814
+ ///
1815
+ /// # <weight>
1816
+ /// Base Weight: 1.717 µs
1817
+ /// Read/Write: Validator Count
1818
+ /// # </weight>
1819
+ #[ weight = 2 * WEIGHT_PER_MICROS + T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ]
1820
+ fn scale_validator_count( origin, factor: Percent ) {
1821
+ ensure_root( origin) ?;
1822
+ ValidatorCount :: mutate( |n| * n += factor * * n) ;
1823
+ }
1824
+
1797
1825
/// Force there to be no new eras indefinitely.
1798
1826
///
1799
1827
/// The dispatch origin must be Root.
0 commit comments