@@ -39,7 +39,7 @@ mod set;
3939pub mod weights;
4040
4141pub use inflation:: { InflationInfo , Range } ;
42- pub use pallet:: { pallet:: * } ;
42+ pub use pallet:: pallet:: * ;
4343pub use set:: OrderedSet ;
4444use weights:: WeightInfo ;
4545
@@ -79,7 +79,7 @@ macro_rules! log {
7979 } ;
8080}
8181
82- #[ derive( Encode , Decode , Clone , Copy , PartialEq , Eq , RuntimeDebug , TypeInfo ) ]
82+ #[ derive( Encode , Decode , Clone , Copy , PartialEq , Eq , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
8383/// A value placed in storage that represents the current version of the Staking storage. This value
8484/// is used by the `on_runtime_upgrade` logic to determine whether we run storage migration logic.
8585enum Releases {
@@ -94,7 +94,9 @@ impl Default for Releases {
9494 }
9595}
9696
97- #[ derive( PartialEq , Eq , PartialOrd , Ord , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
97+ #[ derive(
98+ PartialEq , Eq , PartialOrd , Ord , Clone , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ,
99+ ) ]
98100/// The candidates or the nominators bonded amount to the network
99101pub struct Bond < AccountId , Balance > {
100102 /// The controller account used to reserve their staked balance
@@ -116,7 +118,19 @@ impl<A: Decode, B: Default> Default for Bond<A, B> {
116118 }
117119}
118120
119- #[ derive( Eq , PartialEq , Ord , PartialOrd , Copy , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
121+ #[ derive(
122+ Eq ,
123+ PartialEq ,
124+ Ord ,
125+ PartialOrd ,
126+ Copy ,
127+ Clone ,
128+ Encode ,
129+ Decode ,
130+ RuntimeDebug ,
131+ TypeInfo ,
132+ MaxEncodedLen ,
133+ ) ]
120134/// The activity status of the validator
121135pub enum ValidatorStatus {
122136 /// Committed to be online and producing valid blocks (not equivocating)
@@ -162,7 +176,7 @@ impl<T: Config> Convert<T::AccountId, Option<ValidatorSnapshot<T::AccountId, Bal
162176 }
163177}
164178
165- #[ derive( Encode , Decode , RuntimeDebug , TypeInfo ) ]
179+ #[ derive( Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
166180/// Total staked information of the current chain state
167181pub struct TotalSnapshot < Balance > {
168182 /// The total self-bond of all validator candidates
@@ -314,7 +328,19 @@ impl<
314328}
315329
316330/// Reward destination options.
317- #[ derive( Eq , PartialEq , Ord , PartialOrd , Copy , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
331+ #[ derive(
332+ Eq ,
333+ PartialEq ,
334+ Ord ,
335+ PartialOrd ,
336+ Copy ,
337+ Clone ,
338+ Encode ,
339+ Decode ,
340+ RuntimeDebug ,
341+ TypeInfo ,
342+ MaxEncodedLen ,
343+ ) ]
318344pub enum RewardDestination {
319345 /// Pay into the bonded account, increasing the amount at stake accordingly.
320346 Staked ,
@@ -328,7 +354,7 @@ impl Default for RewardDestination {
328354 }
329355}
330356
331- #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo ) ]
357+ #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
332358/// Info needed to make delayed controller sets after round end
333359pub struct DelayedControllerSet < AccountId > {
334360 /// The bonded stash account
@@ -345,7 +371,7 @@ impl<AccountId: PartialEq + Clone> DelayedControllerSet<AccountId> {
345371 }
346372}
347373
348- #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo ) ]
374+ #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
349375/// Info needed to maked delayed commission sets after round end
350376pub struct DelayedCommissionSet < AccountId > {
351377 /// The bonded controller account
@@ -362,7 +388,7 @@ impl<AccountId: PartialEq + Clone> DelayedCommissionSet<AccountId> {
362388 }
363389}
364390
365- #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo ) ]
391+ #[ derive( Default , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
366392/// Info needed to make delayed payments to stakers after round end
367393pub struct DelayedPayout < Balance > {
368394 /// Total round reward (result of compute_issuance() at round end)
@@ -373,7 +399,19 @@ pub struct DelayedPayout<Balance> {
373399 pub validator_commission : Perbill ,
374400}
375401
376- #[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Copy , Encode , Decode , RuntimeDebug , TypeInfo ) ]
402+ #[ derive(
403+ Eq ,
404+ PartialEq ,
405+ Ord ,
406+ PartialOrd ,
407+ Clone ,
408+ Copy ,
409+ Encode ,
410+ Decode ,
411+ RuntimeDebug ,
412+ TypeInfo ,
413+ MaxEncodedLen ,
414+ ) ]
377415/// Request scheduled to change the candidate self-bond
378416pub struct CandidateBondLessRequest < Balance > {
379417 /// The requested less amount
@@ -504,7 +542,9 @@ impl<
504542 }
505543}
506544
507- #[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
545+ #[ derive(
546+ Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ,
547+ ) ]
508548/// Capacity status for top or bottom nominations
509549pub enum CapacityStatus {
510550 /// Reached capacity
@@ -515,7 +555,9 @@ pub enum CapacityStatus {
515555 Partial ,
516556}
517557
518- #[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
558+ #[ derive(
559+ Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ,
560+ ) ]
519561/// Productivity status for active validators
520562pub enum ProductivityStatus {
521563 /// Successfully produced a block
@@ -526,7 +568,9 @@ pub enum ProductivityStatus {
526568 Ready ,
527569}
528570
529- #[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo ) ]
571+ #[ derive(
572+ Eq , PartialEq , Ord , PartialOrd , Clone , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ,
573+ ) ]
530574/// All candidate info except the top and bottom nominations
531575pub struct CandidateMetadata < AccountId , Balance , BlockNumber > {
532576 /// This candidate's stash account (public key)
@@ -2057,7 +2101,7 @@ impl<
20572101 }
20582102}
20592103
2060- #[ derive( Copy , Clone , PartialEq , Eq , Encode , Decode , RuntimeDebug , TypeInfo ) ]
2104+ #[ derive( Copy , Clone , PartialEq , Eq , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
20612105/// The current round index and transition information
20622106pub struct RoundInfo < BlockNumber > {
20632107 /// Current round index
0 commit comments