use steel::*;
use crate::{
consts::CONFIG_ADDRESS,
state::{Campaign, Config},
};
pub trait AirdropAccountInfoValidation {
fn is_config(&self) -> Result<&Self, ProgramError>;
fn is_campaign(&self) -> Result<&Self, ProgramError>;
}
impl AirdropAccountInfoValidation for AccountInfo<'_> {
fn is_config(&self) -> Result<&Self, ProgramError> {
self.has_address(&CONFIG_ADDRESS)?
.is_type::<Config>(&crate::ID)
}
fn is_campaign(&self) -> Result<&Self, ProgramError> {
self.is_type::<Campaign>(&crate::ID)
}
}