spherenet-program-whitelist-interface 0.1.1

Interface of SphereNet's Program Whitelist Program
Documentation
use {
    super::{account_state::AccountState, Initializable},
    bytemuck::{Pod, Zeroable},
    pinocchio::pubkey::Pubkey,
    shank::ShankAccount,
};

#[repr(C)]
#[derive(Copy, Clone, Pod, Zeroable, ShankAccount)]
pub struct WhitelistEntryAccount {
    pub entry_address: Pubkey,
    pub state: u8,
}

impl WhitelistEntryAccount {
    #[inline(always)]
    pub fn set_initialized(&mut self) {
        self.state = AccountState::Initialized as u8;
    }
}

impl Initializable for WhitelistEntryAccount {
    #[inline(always)]
    fn is_initialized(&self) -> bool {
        self.state != AccountState::Uninitialized as u8
    }
}