This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ pub fn make_persisted_validation_data<T: paras::Config + hrmp::Config>(
4343
4444/// Take an active subset of a set containing all validators.
4545///
46- /// First item in pair will be all items in set have indeces found in the `active` indices set (in
46+ /// First item in pair will be all items in set have indices found in the `active` indices set (in
4747/// the order of the `active` vec, the second item will contain the rest, in the original order.
4848///
4949/// ```ignore
50- /// split_active_subset(active.into_iter().collect() , all).0 == take_active_subset(active, all)
50+ /// split_active_subset(active, all).0 == take_active_subset(active, all)
5151/// ```
5252pub fn split_active_subset < T : Clone > ( active : & [ ValidatorIndex ] , all : & [ T ] ) -> ( Vec < T > , Vec < T > ) {
5353 let active_set: BTreeSet < _ > = active. iter ( ) . cloned ( ) . collect ( ) ;
@@ -73,6 +73,10 @@ pub fn split_active_subset<T: Clone>(active: &[ValidatorIndex], all: &[T]) -> (V
7373}
7474
7575/// Uses `split_active_subset` and concatenates the inactive to the active vec.
76+ ///
77+ /// ```ignore
78+ /// split_active_subset(active, all)[0..active.len()]) == take_active_subset(active, all)
79+ /// ```
7680pub fn take_active_subset_and_inactive < T : Clone > ( active : & [ ValidatorIndex ] , all : & [ T ] ) -> Vec < T > {
7781 let ( mut a, mut i) = split_active_subset ( active, all) ;
7882 a. append ( & mut i) ;
You can’t perform that action at this time.
0 commit comments