pub fn finalize_vote(
        &mut self,
        max_voter_weight: u64,
        config: &GovernanceConfig,
        current_unix_timestamp: UnixTimestamp,
    ) -> Result<(), ProgramError> {
        self.assert_can_finalize_vote(config, current_unix_timestamp)?;

        self.state = self.resolve_final_vote_state(max_voter_weight, config)?;
        // TODO: set voting_completed_at based on the time when the voting ended and not when we finalized the proposal
        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(())
    }
/// Finalizes vote by moving it to final state Succeeded or Defeated if max_voting_time has passed
/// If Proposal is still within max_voting_time period then error is returned
Finalizes vote by moving it to final state Succeeded or Defeated if max_voting_time has passed
If Proposal is still within max_voting_time period then error is returned
Finalizes vote by moving it to final state Succeeded or Defeated if max_voting_time has passed If Proposal is still within max_voting_time period then error is returned
pub fn finalize_vote(
        &mut self,
        max_voter_weight: u64,
        config: &GovernanceConfig,
        current_unix_timestamp: UnixTimestamp,
    ) -> Result<(), ProgramError> {
        self.assert_can_finalize_vote(config, current_unix_timestamp)?;
        self.state = self.resolve_final_vote_state(max_voter_weight, config)?;
        // TODO: set voting_completed_at based on the time when the voting ended and not when we finalized the proposal
        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(())
    }
pub fn finalize_vote ( & mut self , max_voter_weight : u64 , config : & GovernanceConfig , current_unix_timestamp : UnixTimestamp , ) -> Result < ( ) , ProgramError > { self . assert_can_finalize_vote ( config , current_unix_timestamp ) ? ; self . state = self . resolve_final_vote_state ( max_voter_weight , config ) ? ; // TODO: set voting_completed_at based on the time when the voting ended and not when we finalized the proposal 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 ( ( ) ) }
Finalizes vote by moving it to final state Succeeded or Defeated if max_voting_time has passed
If Proposal is still within max_voting_time period then error is returned
Finalizes vote by moving it to final state Succeeded or Defeated if max_voting_time has passed If Proposal is still within max_voting_time period then error is returned
&mut self
max_voter_weight
u64
config
&GovernanceConfig
current_unix_timestamp
UnixTimestamp
&mut self
max_voter_weight
u64
config
&GovernanceConfig
current_unix_timestamp
UnixTimestamp