glin_types/
block.rs

1//! Block-related types
2
3use serde::{Deserialize, Serialize};
4
5/// Block hash (hex-encoded)
6pub type BlockHash = String;
7
8/// Simplified block representation
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Block {
11    /// Block number
12    pub number: u64,
13    /// Block hash
14    pub hash: BlockHash,
15    /// Parent block hash
16    pub parent_hash: BlockHash,
17    /// Timestamp (Unix timestamp in milliseconds)
18    pub timestamp: u64,
19}
20
21/// Block header information
22#[derive(Debug, Clone, Serialize, Deserialize)]
23pub struct BlockHeader {
24    /// Block number
25    pub number: u64,
26    /// Block hash
27    pub hash: BlockHash,
28    /// Parent block hash
29    pub parent_hash: BlockHash,
30    /// State root
31    pub state_root: String,
32    /// Extrinsics root
33    pub extrinsics_root: String,
34}