pub fn assert_is_valid_max_voter_weight(
    max_voter_weight_record: &MaxVoterWeightRecord,
) -> Result<(), ProgramError> {
    // Assert max voter weight is not stale
    if let Some(max_voter_weight_expiry) = max_voter_weight_record.max_voter_weight_expiry {
        let slot = Clock::get()?.slot;

        if slot > max_voter_weight_expiry {
            return Err(GovernanceError::MaxVoterWeightRecordExpired.into());
        }
    }

    Ok(())
}
/// Asserts MaxVoterWeightRecord hasn't expired
Asserts MaxVoterWeightRecord hasn't expired
Asserts MaxVoterWeightRecord hasn ' t expired
pub fn assert_is_valid_max_voter_weight(
    max_voter_weight_record: &MaxVoterWeightRecord,
) -> Result<(), ProgramError> {
    // Assert max voter weight is not stale
    if let Some(max_voter_weight_expiry) = max_voter_weight_record.max_voter_weight_expiry {
        let slot = Clock::get()?.slot;
        if slot > max_voter_weight_expiry {
            return Err(GovernanceError::MaxVoterWeightRecordExpired.into());
        }
    }
    Ok(())
}
pub fn assert_is_valid_max_voter_weight ( max_voter_weight_record : & MaxVoterWeightRecord , ) -> Result < ( ) , ProgramError > { // Assert max voter weight is not stale if let Some ( max_voter_weight_expiry ) = max_voter_weight_record . max_voter_weight_expiry { let slot = Clock :: get ( ) ? . slot ; if slot > max_voter_weight_expiry { return Err ( GovernanceError :: MaxVoterWeightRecordExpired . into ( ) ) ; } } Ok ( ( ) ) }
Asserts MaxVoterWeightRecord hasn't expired
Asserts MaxVoterWeightRecord hasn ' t expired
max_voter_weight_record
&MaxVoterWeightRecord
max_voter_weight_record
&MaxVoterWeightRecord