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
33
34
35
36
37
38
39
40
use {crate::accounts_hash::AccountsHash, solana_sdk::hash::Hash};
mod utils;
pub use utils::*;
mod manager;
pub use manager::Manager as EpochAccountsHashManager;
#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone, Copy)]
pub struct EpochAccountsHash(Hash);
impl AsRef<Hash> for EpochAccountsHash {
fn as_ref(&self) -> &Hash {
&self.0
}
}
impl EpochAccountsHash {
#[must_use]
pub const fn new(accounts_hash: Hash) -> Self {
Self(accounts_hash)
}
}
impl From<AccountsHash> for EpochAccountsHash {
fn from(accounts_hash: AccountsHash) -> EpochAccountsHash {
Self::new(accounts_hash.0)
}
}