@@ -19,7 +19,6 @@ use codec::{Decode, Encode};
1919use frame_support:: sp_runtime:: transaction_validity:: InvalidTransaction ;
2020use frame_support:: sp_runtime:: transaction_validity:: ValidTransaction ;
2121use scale_info:: TypeInfo ;
22- use sp_core:: Get ;
2322use sp_runtime:: {
2423 traits:: { DispatchInfoOf , Dispatchable , PostDispatchInfoOf , SignedExtension } ,
2524 transaction_validity:: { TransactionValidity , TransactionValidityError } ,
@@ -160,6 +159,8 @@ pub mod pallet {
160159 type InitialMaxAllowedValidators : Get < u16 > ;
161160 #[ pallet:: constant] // Initial default delegation take.
162161 type InitialDefaultTake : Get < u16 > ;
162+ #[ pallet:: constant] // Initial minimum delegation take.
163+ type InitialMinTake : Get < u16 > ;
163164 #[ pallet:: constant] // Initial weights version key.
164165 type InitialWeightsVersionKey : Get < u64 > ;
165166 #[ pallet:: constant] // Initial serving rate limit.
@@ -214,6 +215,10 @@ pub mod pallet {
214215 T :: InitialDefaultTake :: get ( )
215216 }
216217 #[ pallet:: type_value]
218+ pub fn DefaultMinTake < T : Config > ( ) -> u16 {
219+ T :: InitialMinTake :: get ( )
220+ }
221+ #[ pallet:: type_value]
217222 pub fn DefaultAccountTake < T : Config > ( ) -> u64 {
218223 0
219224 }
@@ -249,7 +254,9 @@ pub mod pallet {
249254 #[ pallet:: storage] // --- ITEM ( total_stake )
250255 pub type TotalStake < T > = StorageValue < _ , u64 , ValueQuery > ;
251256 #[ pallet:: storage] // --- ITEM ( default_take )
252- pub type DefaultTake < T > = StorageValue < _ , u16 , ValueQuery , DefaultDefaultTake < T > > ;
257+ pub type MaxTake < T > = StorageValue < _ , u16 , ValueQuery , DefaultDefaultTake < T > > ;
258+ #[ pallet:: storage] // --- ITEM ( min_take )
259+ pub type MinTake < T > = StorageValue < _ , u16 , ValueQuery , DefaultMinTake < T > > ;
253260 #[ pallet:: storage] // --- ITEM ( global_block_emission )
254261 pub type BlockEmission < T > = StorageValue < _ , u64 , ValueQuery , DefaultBlockEmission < T > > ;
255262 #[ pallet:: storage] // --- ITEM ( total_issuance )
@@ -935,6 +942,8 @@ pub mod pallet {
935942 old_hotkey : T :: AccountId ,
936943 new_hotkey : T :: AccountId ,
937944 } , // Event created when a hotkey is swapped
945+ MaxDelegateTakeSet ( u16 ) , // Event emitted when maximum delegate take is set by sudo/admin transaction
946+ MinDelegateTakeSet ( u16 ) , // Event emitted when minimum delegate take is set by sudo/admin transaction
938947 }
939948
940949 // Errors inform users that something went wrong.
0 commit comments