pub fn try_tip_vote(
        &mut self,
        max_voter_weight: u64,
        config: &GovernanceConfig,
        current_unix_timestamp: UnixTimestamp,
    ) -> Result<bool, ProgramError> {
        if let Some(tipped_state) = self.try_get_tipped_vote_state(max_voter_weight, config) {
            self.state = tipped_state;
            self.voting_completed_at = Some(current_unix_timestamp);

            // Capture vote params to correctly display historical results
            self.max_vote_weight = Some(max_voter_weight);
            self.vote_threshold_percentage = Some(config.vote_threshold_percentage.clone());

            Ok(true)
        } else {
            Ok(false)
        }
    }
/// Checks if vote can be tipped and automatically transitioned to Succeeded or Defeated state
/// If the conditions are met the state is updated accordingly
Checks if vote can be tipped and automatically transitioned to Succeeded or Defeated state
If the conditions are met the state is updated accordingly
Checks if vote can be tipped and automatically transitioned to Succeeded or Defeated state If the conditions are met the state is updated accordingly
pub fn try_tip_vote(
        &mut self,
        max_voter_weight: u64,
        config: &GovernanceConfig,
        current_unix_timestamp: UnixTimestamp,
    ) -> Result<bool, ProgramError> {
        if let Some(tipped_state) = self.try_get_tipped_vote_state(max_voter_weight, config) {
            self.state = tipped_state;
            self.voting_completed_at = Some(current_unix_timestamp);
            // Capture vote params to correctly display historical results
            self.max_vote_weight = Some(max_voter_weight);
            self.vote_threshold_percentage = Some(config.vote_threshold_percentage.clone());
            Ok(true)
        } else {
            Ok(false)
        }
    }
pub fn try_tip_vote ( & mut self , max_voter_weight : u64 , config : & GovernanceConfig , current_unix_timestamp : UnixTimestamp , ) -> Result < bool , ProgramError > { if let Some ( tipped_state ) = self . try_get_tipped_vote_state ( max_voter_weight , config ) { self . state = tipped_state ; self . voting_completed_at = Some ( current_unix_timestamp ) ; // Capture vote params to correctly display historical results self . max_vote_weight = Some ( max_voter_weight ) ; self . vote_threshold_percentage = Some ( config . vote_threshold_percentage . clone ( ) ) ; Ok ( true ) } else { Ok ( false ) } }
Checks if vote can be tipped and automatically transitioned to Succeeded or Defeated state
If the conditions are met the state is updated accordingly
Checks if vote can be tipped and automatically transitioned to Succeeded or Defeated state If the conditions are met the state is updated accordingly
&mut self
max_voter_weight
u64
config
&GovernanceConfig
current_unix_timestamp
UnixTimestamp
&mut self
max_voter_weight
u64
config
&GovernanceConfig
current_unix_timestamp
UnixTimestamp