tendermint/chain/
info.rs

1use crate::{block, chain, time::Time};
2
3/// Information about a particular Tendermint blockchain
4#[derive(Clone, Debug)]
5pub struct Info {
6    /// Chain identifier (e.g. 'gaia-9000')
7    pub id: chain::Id,
8
9    /// Current block height of the chain
10    pub height: block::Height,
11
12    /// Last block ID seen for this chain
13    pub last_block_id: Option<block::Id>,
14
15    /// Current consensus time (if available)
16    pub time: Option<Time>,
17}
18
19impl Info {
20    /// Create information about a particular network
21    pub fn new<I>(id: I) -> Self
22    where
23        I: Into<chain::Id>,
24    {
25        Self {
26            id: id.into(),
27            height: Default::default(),
28            last_block_id: None,
29            time: None,
30        }
31    }
32}