1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use borsh::{BorshDeserialize, BorshSerialize};
use shank::ShankAccount;
use super::{Key, SolanaAccount};
#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone, ShankAccount)]
pub struct FrequencyAccount {
pub key: Key,
pub last_update: i64,
pub period: i64,
}
impl FrequencyAccount {
pub fn new(last_update: i64, period: i64) -> Self {
Self {
key: Key::Frequency,
last_update,
period,
}
}
}
impl SolanaAccount for FrequencyAccount {
fn key() -> Key {
Key::Frequency
}
}