pub fn assert_spl_token_mint_authority_is_signer(
    mint_info: &AccountInfo,
    mint_authority_info: &AccountInfo,
) -> Result<(), ProgramError> {
    let mint_authority = get_spl_token_mint_authority(mint_info)?;

    if mint_authority.is_none() {
        return Err(GovernanceError::MintHasNoAuthority.into());
    }

    if !mint_authority.contains(mint_authority_info.key) {
        return Err(GovernanceError::InvalidMintAuthority.into());
    }

    if !mint_authority_info.is_signer {
        return Err(GovernanceError::MintAuthorityMustSign.into());
    }

    Ok(())
}
/// Asserts current mint authority matches the given authority and it's signer of the transaction
Asserts current mint authority matches the given authority and it's signer of the transaction
Asserts current mint authority matches the given authority and it ' s signer of the transaction
pub fn assert_spl_token_mint_authority_is_signer(
    mint_info: &AccountInfo,
    mint_authority_info: &AccountInfo,
) -> Result<(), ProgramError> {
    let mint_authority = get_spl_token_mint_authority(mint_info)?;
    if mint_authority.is_none() {
        return Err(GovernanceError::MintHasNoAuthority.into());
    }
    if !mint_authority.contains(mint_authority_info.key) {
        return Err(GovernanceError::InvalidMintAuthority.into());
    }
    if !mint_authority_info.is_signer {
        return Err(GovernanceError::MintAuthorityMustSign.into());
    }
    Ok(())
}
pub fn assert_spl_token_mint_authority_is_signer ( mint_info : & AccountInfo , mint_authority_info : & AccountInfo , ) -> Result < ( ) , ProgramError > { let mint_authority = get_spl_token_mint_authority ( mint_info ) ? ; if mint_authority . is_none ( ) { return Err ( GovernanceError :: MintHasNoAuthority . into ( ) ) ; } if ! mint_authority . contains ( mint_authority_info . key ) { return Err ( GovernanceError :: InvalidMintAuthority . into ( ) ) ; } if ! mint_authority_info . is_signer { return Err ( GovernanceError :: MintAuthorityMustSign . into ( ) ) ; } Ok ( ( ) ) }
Asserts current mint authority matches the given authority and it's signer of the transaction
Asserts current mint authority matches the given authority and it ' s signer of the transaction
mint_info
&AccountInfo
mint_authority_info
&AccountInfo
mint_info
&AccountInfo
mint_authority_info
&AccountInfo