triggr-program 0.1.1

Created with Anchor
Documentation
use anchor_lang::prelude::*;

#[derive(Clone, Default, PartialEq, Eq, Debug, AnchorDeserialize, AnchorSerialize)]
pub struct Statistics {
    /// The number of times the task has been executed.
    pub execution_count: u64,

    /// The timestamp when the task was last triggered.
    pub last_executed_at: i64,
}

impl Statistics {
    pub const MIN_SIZE: usize = 8 + 8;

    pub fn new() -> Self {
        Statistics {
            execution_count: 0,
            last_executed_at: 0,
        }
    }
}