mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add Header AT to EthChainSpec (#13046)
This commit is contained in:
@ -14,6 +14,9 @@ pub trait EthChainSpec: Send + Sync + Unpin + Debug {
|
||||
// todo: make chain spec type generic over hardfork
|
||||
//type Hardfork: Clone + Copy + 'static;
|
||||
|
||||
/// The header type of the network.
|
||||
type Header;
|
||||
|
||||
/// Returns the [`Chain`] object this spec targets.
|
||||
fn chain(&self) -> Chain;
|
||||
|
||||
@ -41,7 +44,7 @@ pub trait EthChainSpec: Send + Sync + Unpin + Debug {
|
||||
fn display_hardforks(&self) -> Box<dyn Display>;
|
||||
|
||||
/// The genesis header.
|
||||
fn genesis_header(&self) -> &Header;
|
||||
fn genesis_header(&self) -> &Self::Header;
|
||||
|
||||
/// The genesis block specification.
|
||||
fn genesis(&self) -> &Genesis;
|
||||
@ -64,6 +67,8 @@ pub trait EthChainSpec: Send + Sync + Unpin + Debug {
|
||||
}
|
||||
|
||||
impl EthChainSpec for ChainSpec {
|
||||
type Header = Header;
|
||||
|
||||
fn chain(&self) -> Chain {
|
||||
self.chain
|
||||
}
|
||||
@ -92,7 +97,7 @@ impl EthChainSpec for ChainSpec {
|
||||
Box::new(Self::display_hardforks(self))
|
||||
}
|
||||
|
||||
fn genesis_header(&self) -> &Header {
|
||||
fn genesis_header(&self) -> &Self::Header {
|
||||
self.genesis_header()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user