@@ -326,23 +326,31 @@ pub mod pallet {
326326 #[ derive( CloneNoBound , Encode , Decode , TypeInfo , MaxEncodedLen ) ]
327327 #[ scale_info( skip_type_params( MaxValidators ) ) ]
328328 /// Committee info type used on-chain.
329- pub struct CommitteeInfo < CommitteeMember : Clone , MaxValidators > {
329+ pub struct CommitteeInfo < AuthorityId : Clone , AuthorityKeys : Clone , MaxValidators > {
330330 /// Epoch number the committee is selected for.
331331 pub epoch : ScEpochNumber ,
332332 /// List of committee members.
333- pub committee : BoundedVec < CommitteeMember , MaxValidators > ,
333+ pub committee : BoundedVec < CommitteeMember < AuthorityId , AuthorityKeys > , MaxValidators > ,
334334 }
335335
336- impl < CommitteeMember : Clone , MaxValidators > CommitteeInfo < CommitteeMember , MaxValidators > {
336+ /// Committee information type used by the pallet
337+ pub type CommitteeInfoOf < T > = CommitteeInfo <
338+ <T as Config >:: AuthorityId ,
339+ <T as Config >:: AuthorityKeys ,
340+ <T as Config >:: MaxValidators ,
341+ > ;
342+
343+ impl < AuthorityId : Clone , AuthorityKeys : Clone , MaxValidators >
344+ CommitteeInfo < AuthorityId , AuthorityKeys , MaxValidators >
345+ {
337346 /// Returns committee info as a pair of epoch number and list of committee members
338- pub fn as_pair ( self ) -> ( ScEpochNumber , Vec < CommitteeMember > ) {
347+ pub fn as_pair ( self ) -> ( ScEpochNumber , Vec < CommitteeMember < AuthorityId , AuthorityKeys > > ) {
339348 ( self . epoch , self . committee . to_vec ( ) )
340349 }
341350 }
342351
343- impl < CommitteeMember , MaxValidators > Default for CommitteeInfo < CommitteeMember , MaxValidators >
344- where
345- CommitteeMember : Clone ,
352+ impl < AuthorityId : Clone , AuthorityKeys : Clone , MaxValidators > Default
353+ for CommitteeInfo < AuthorityId , AuthorityKeys , MaxValidators >
346354 {
347355 fn default ( ) -> Self {
348356 Self { epoch : ScEpochNumber :: zero ( ) , committee : BoundedVec :: new ( ) }
@@ -354,12 +362,10 @@ pub mod pallet {
354362 StorageValue < _ , BoundedBTreeSet < T :: AccountId , T :: MaxValidators > , ValueQuery > ;
355363
356364 #[ pallet:: storage]
357- pub type CurrentCommittee < T : Config > =
358- StorageValue < _ , CommitteeInfo < CommitteeMemberOf < T > , T :: MaxValidators > , ValueQuery > ;
365+ pub type CurrentCommittee < T : Config > = StorageValue < _ , CommitteeInfoOf < T > , ValueQuery > ;
359366
360367 #[ pallet:: storage]
361- pub type NextCommittee < T : Config > =
362- StorageValue < _ , CommitteeInfo < CommitteeMemberOf < T > , T :: MaxValidators > , OptionQuery > ;
368+ pub type NextCommittee < T : Config > = StorageValue < _ , CommitteeInfoOf < T > , OptionQuery > ;
363369
364370 /// Stores the stage of handling the inputs change. Used by session manager, to decide
365371 /// if the session should be ended quickly, to speed up using the newly selected committee.
@@ -578,14 +584,13 @@ pub mod pallet {
578584 }
579585
580586 /// Returns current committee from storage.
581- pub fn current_committee_storage ( ) -> CommitteeInfo < CommitteeMemberOf < T > , T :: MaxValidators >
582- {
587+ pub fn current_committee_storage ( ) -> CommitteeInfoOf < T > {
583588 CurrentCommittee :: < T > :: get ( )
584589 }
585590
586591 /// Returns next committee from storage.
587592 pub fn next_committee_storage ( )
588- -> Option < CommitteeInfo < CommitteeMemberOf < T > , T :: MaxValidators > > {
593+ -> Option < CommitteeInfo < T :: AuthorityId , T :: AuthorityKeys , T :: MaxValidators > > {
589594 NextCommittee :: < T > :: get ( )
590595 }
591596
0 commit comments