File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
crates/pallet-humanode-session/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ mod mock;
2525mod tests;
2626mod utils;
2727
28+ use self :: utils:: DedupeIteratorExt as _;
29+
2830/// The type representing the session index in our chain.
2931type SessionIndex = u32 ;
3032
@@ -278,6 +280,7 @@ impl<T: Config> Pallet<T> {
278280 bootnodes
279281 . chain ( bioauth_active_authentications)
280282 . chain ( fixed_validators)
283+ . dedupe ( AccountIdDedupeKey :: < T > :: default ( ) )
281284 }
282285
283286 /// Clears and re-populates the [`SessionIdentities`] for a given session with the entries.
@@ -355,3 +358,20 @@ impl<T: Config> sp_runtime::traits::Convert<T::AccountId, Option<IdentificationF
355358 <SessionIdentities < T > >:: get ( session_index, account_id)
356359 }
357360}
361+
362+ /// The dedupe key extractor that provides Account Ids from Identification Tuples.
363+ struct AccountIdDedupeKey < T > ( core:: marker:: PhantomData < T > ) ;
364+
365+ impl < T : Config > utils:: DedupeKeyExtractor < IdentificationTupleFor < T > > for AccountIdDedupeKey < T > {
366+ type Output = <T as frame_system:: Config >:: AccountId ;
367+
368+ fn extract_key ( & self , value : & IdentificationTupleFor < T > ) -> Self :: Output {
369+ value. 0 . clone ( )
370+ }
371+ }
372+
373+ impl < T > Default for AccountIdDedupeKey < T > {
374+ fn default ( ) -> Self {
375+ Self ( core:: marker:: PhantomData )
376+ }
377+ }
You can’t perform that action at this time.
0 commit comments