pub fn assert_spl_token_owner_is_signer(
    token_info: &AccountInfo,
    token_owner_info: &AccountInfo,
) -> Result<(), ProgramError> {
    let token_owner = get_spl_token_owner(token_info)?;

    if token_owner != *token_owner_info.key {
        return Err(GovernanceError::InvalidTokenOwner.into());
    }

    if !token_owner_info.is_signer {
        return Err(GovernanceError::TokenOwnerMustSign.into());
    }

    Ok(())
}
/// Asserts current token owner matches the given owner and it's signer of the transaction
Asserts current token owner matches the given owner and it's signer of the transaction
Asserts current token owner matches the given owner and it ' s signer of the transaction
pub fn assert_spl_token_owner_is_signer(
    token_info: &AccountInfo,
    token_owner_info: &AccountInfo,
) -> Result<(), ProgramError> {
    let token_owner = get_spl_token_owner(token_info)?;
    if token_owner != *token_owner_info.key {
        return Err(GovernanceError::InvalidTokenOwner.into());
    }
    if !token_owner_info.is_signer {
        return Err(GovernanceError::TokenOwnerMustSign.into());
    }
    Ok(())
}
pub fn assert_spl_token_owner_is_signer ( token_info : & AccountInfo , token_owner_info : & AccountInfo , ) -> Result < ( ) , ProgramError > { let token_owner = get_spl_token_owner ( token_info ) ? ; if token_owner != * token_owner_info . key { return Err ( GovernanceError :: InvalidTokenOwner . into ( ) ) ; } if ! token_owner_info . is_signer { return Err ( GovernanceError :: TokenOwnerMustSign . into ( ) ) ; } Ok ( ( ) ) }
Asserts current token owner matches the given owner and it's signer of the transaction
Asserts current token owner matches the given owner and it ' s signer of the transaction
token_info
&AccountInfo
token_owner_info
&AccountInfo
token_info
&AccountInfo
token_owner_info
&AccountInfo