pub fn verify(&self, account: &AccountInfo) -> Result<(), ProgramError> {
        match self {
            Authority::Basic(pubkey) => {
                if *pubkey == Pubkey::default() {
                    msg!("Basic authority has null pubkey");
                    Err(StakingError::InvalidAuthorityType.into())
                } else if *pubkey != *account.key {
                    Err(StakingError::AuthorityKeysDoNotMatch.into())
                } else {
                    Ok(())
                }
            }
            Authority::NFT(mint) => {
                if *mint == Pubkey::default() {
                    msg!("NFT authority has null account");
                    Err(StakingError::InvalidAuthorityType.into())
                } else if *mint != *account.key {
                    Err(StakingError::AuthorityKeysDoNotMatch.into())
                } else {
                    match is_nft_mint!(account.data.borrow()) {
                        Ok(_) => Ok(()),
                        Err(err) => Err(err.into()),
                    }
                }
            }
        }
    }
/// Verifies that an account matches the authority's type
Verifies that an account matches the authority's type
Verifies that an account matches the authority ' s type
pub fn verify(&self, account: &AccountInfo) -> Result<(), ProgramError> {
        match self {
            Authority::Basic(pubkey) => {
                if *pubkey == Pubkey::default() {
                    msg!("Basic authority has null pubkey");
                    Err(StakingError::InvalidAuthorityType.into())
                } else if *pubkey != *account.key {
                    Err(StakingError::AuthorityKeysDoNotMatch.into())
                } else {
                    Ok(())
                }
            }
            Authority::NFT(mint) => {
                if *mint == Pubkey::default() {
                    msg!("NFT authority has null account");
                    Err(StakingError::InvalidAuthorityType.into())
                } else if *mint != *account.key {
                    Err(StakingError::AuthorityKeysDoNotMatch.into())
                } else {
                    match is_nft_mint!(account.data.borrow()) {
                        Ok(_) => Ok(()),
                        Err(err) => Err(err.into()),
                    }
                }
            }
        }
    }
pub fn verify ( & self , account : & AccountInfo ) -> Result < ( ) , ProgramError > { match self { Authority :: Basic ( pubkey ) => { if * pubkey == Pubkey :: default ( ) { msg ! ( " " ) ; Err ( StakingError :: InvalidAuthorityType . into ( ) ) } else if * pubkey != * account . key { Err ( StakingError :: AuthorityKeysDoNotMatch . into ( ) ) } else { Ok ( ( ) ) } } Authority :: NFT ( mint ) => { if * mint == Pubkey :: default ( ) { msg ! ( " " ) ; Err ( StakingError :: InvalidAuthorityType . into ( ) ) } else if * mint != * account . key { Err ( StakingError :: AuthorityKeysDoNotMatch . into ( ) ) } else { match is_nft_mint ! ( account data borrow ( ) ) { Ok ( _ ) => Ok ( ( ) ) , Err ( err ) => Err ( err . into ( ) ) , } } } } }
Verifies that an account matches the authority's type
Verifies that an account matches the authority ' s type
&self
account
&AccountInfo
&self
account
&AccountInfo