axos_primitives/
blocks.rs1use alloy_primitives::B256;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Copy, Eq, PartialEq, Default, Serialize, Deserialize)]
6pub struct BlockInfo {
7 pub hash: B256,
9 pub number: u64,
11 pub parent_hash: B256,
13 pub timestamp: u64,
15}
16
17impl BlockInfo {
18 pub fn new(hash: B256, number: u64, parent_hash: B256, timestamp: u64) -> Self {
20 Self {
21 hash,
22 number,
23 parent_hash,
24 timestamp,
25 }
26 }
27}
28
29#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
31pub struct Epoch {
32 pub number: u64,
34 pub hash: B256,
36 pub timestamp: u64,
38}
39
40impl Epoch {
41 pub fn new(number: u64, hash: B256, timestamp: u64) -> Self {
43 Self {
44 number,
45 hash,
46 timestamp,
47 }
48 }
49}