fn add_validator_set(
		who: T::AccountId,
		val: Validator<<T as frame_system::Config>::AccountId>,
		new_val_set: ValidatorSet<<T as frame_system::Config>::AccountId>,
	) {
		log::info!("🐙 Adding to the voters: {:#?}", new_val_set);
		let index = 0;
		<CandidateValidatorSets<T>>::mutate(|val_sets| {
			// TODO
			if val_sets.len() == 0 {
				val_sets.push(new_val_set.clone());
			}
		});

		<Voters<T>>::mutate(index, |vals| {
			let exist = vals.iter().find(|v| v.id == val.id);
			match exist {
				Some(id) => {
					log::info!("🐙 duplicated ocw tx: {:?}", id);
				}
				None => vals.push(val),
			}
		});

		Self::deposit_event(RawEvent::NewVoterFor(new_val_set, who));
	}
/// Add new validator set to the CandidateValidatorSets.
Add new validator set to the CandidateValidatorSets.
Add new validator set to the CandidateValidatorSets .
fn add_validator_set(
		who: T::AccountId,
		val: Validator<<T as frame_system::Config>::AccountId>,
		new_val_set: ValidatorSet<<T as frame_system::Config>::AccountId>,
	) {
		log::info!("🐙 Adding to the voters: {:#?}", new_val_set);
		let index = 0;
		<CandidateValidatorSets<T>>::mutate(|val_sets| {
			// TODO
			if val_sets.len() == 0 {
				val_sets.push(new_val_set.clone());
			}
		});
		<Voters<T>>::mutate(index, |vals| {
			let exist = vals.iter().find(|v| v.id == val.id);
			match exist {
				Some(id) => {
					log::info!("🐙 duplicated ocw tx: {:?}", id);
				}
				None => vals.push(val),
			}
		});
		Self::deposit_event(RawEvent::NewVoterFor(new_val_set, who));
	}
fn add_validator_set ( who : T :: AccountId , val : Validator < < T as frame_system :: Config > :: AccountId > , new_val_set : ValidatorSet < < T as frame_system :: Config > :: AccountId > , ) { log :: info ! ( " n _val_set); let index = 0 ; < CandidateValidatorSets < T > > :: mutate ( | val_sets | { // TODO if val_sets . len ( ) == 0 { val_sets . push ( new_val_set . clone ( ) ) ; } } ) ; < Voters < T > > :: mutate ( index , | vals | { let exist = vals . iter ( ) . find ( | v | v . id == val . id ) ; match exist { Some ( id ) => { log :: info ! ( " i ; } None => vals . push ( val ) , } } ) ; Self :: deposit_event ( RawEvent :: NewVoterFor ( new_val_set , who ) ) ; }
Add new validator set to the CandidateValidatorSets.
Add new validator set to the CandidateValidatorSets .
who
T::AccountId
val
Validator<<T as frame_system::Config>::AccountId>
new_val_set
ValidatorSet<<T as frame_system::Config>::AccountId>
who
T::AccountId
val
Validator<<T as frame_system::Config>::AccountId>
new_val_set
ValidatorSet<<T as frame_system::Config>::AccountId>