pub(crate) fn activate_validator(
        &mut self,
        id: C::ValidatorId,
        secret: C::ValidatorSecret,
        current_time: Timestamp,
        unit_hash_file: Option<PathBuf>,
        target_ftt: Weight,
    ) -> Vec<Effect<C>> {
        if self.active_validator.is_some() {
            error!(?id, "activate_validator called twice");
            return vec![];
        }
        let idx = match self.validators.get_index(&id) {
            Some(idx) => idx,
            None => {
                error!(?id, "missing own validator ID");
                return vec![];
            }
        };
        let start_time = current_time.max(self.state.params().start_timestamp());
        let (av, effects) = ActiveValidator::new(
            idx,
            secret,
            current_time,
            start_time,
            &self.state,
            unit_hash_file,
            target_ftt,
            self.instance_id,
        );
        self.active_validator = Some(av);
        self.add_new_own_vertices(effects, current_time)
    }
/// Turns this instance from a passive observer into an active validator that proposes new
/// blocks and creates and signs new vertices.
///
/// Panics if `id` is not the ID of a validator with a weight in this Highway instance.
Turns this instance from a passive observer into an active validator that proposes new
blocks and creates and signs new vertices.

Panics if `id` is not the ID of a validator with a weight in this Highway instance.
Turns this instance from a passive observer into an active validator that proposes new blocks and creates and signs new vertices . Panics if ` id ` is not the ID of a validator with a weight in this Highway instance .
pub(crate) fn activate_validator(
        &mut self,
        id: C::ValidatorId,
        secret: C::ValidatorSecret,
        current_time: Timestamp,
        unit_hash_file: Option<PathBuf>,
        target_ftt: Weight,
    ) -> Vec<Effect<C>> {
        if self.active_validator.is_some() {
            error!(?id, "activate_validator called twice");
            return vec![];
        }
        let idx = match self.validators.get_index(&id) {
            Some(idx) => idx,
            None => {
                error!(?id, "missing own validator ID");
                return vec![];
            }
        };
        let start_time = current_time.max(self.state.params().start_timestamp());
        let (av, effects) = ActiveValidator::new(
            idx,
            secret,
            current_time,
            start_time,
            &self.state,
            unit_hash_file,
            target_ftt,
            self.instance_id,
        );
        self.active_validator = Some(av);
        self.add_new_own_vertices(effects, current_time)
    }
pub ( crate ) fn activate_validator ( & mut self , id : C :: ValidatorId , secret : C :: ValidatorSecret , current_time : Timestamp , unit_hash_file : Option < PathBuf > , target_ftt : Weight , ) -> Vec < Effect < C > > { if self . active_validator . is_some ( ) { error ! ( id " " ) ; return vec ! [ ] ; } let idx = match self . validators . get_index ( & id ) { Some ( idx ) => idx , None => { error ! ( id " " ) ; return vec ! [ ] ; } } ; let start_time = current_time . max ( self . state . params ( ) . start_timestamp ( ) ) ; let ( av , effects ) = ActiveValidator :: new ( idx , secret , current_time , start_time , & self . state , unit_hash_file , target_ftt , self . instance_id , ) ; self . active_validator = Some ( av ) ; self . add_new_own_vertices ( effects , current_time ) }
Turns this instance from a passive observer into an active validator that proposes new
blocks and creates and signs new vertices.
Turns this instance from a passive observer into an active validator that proposes new blocks and creates and signs new vertices .
&mut self
id
C::ValidatorId
secret
C::ValidatorSecret
current_time
Timestamp
unit_hash_file
Option<PathBuf>
target_ftt
Weight
&mut self
id
C::ValidatorId
secret
C::ValidatorSecret
current_time
Timestamp
unit_hash_file
Option<PathBuf>
target_ftt
Weight