reth_chainspec/
info.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockNumber, B256};

/// Current status of the blockchain's head.
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq)]
pub struct ChainInfo {
    /// The block hash of the highest fully synced block.
    pub best_hash: B256,
    /// The block number of the highest fully synced block.
    pub best_number: BlockNumber,
}

impl From<ChainInfo> for BlockNumHash {
    fn from(value: ChainInfo) -> Self {
        Self { number: value.best_number, hash: value.best_hash }
    }
}