use serde::{Deserialize, Serialize};

/// Generic cache wrapper for Redis-stored account data.
///
/// The indexer writes accounts to Redis wrapped in this struct,
/// with the account data and the Solana slot at which it was last updated.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Cache<T> {
    pub account: T,
    #[serde(default)]
    pub last_updated_slot: u64,
}
