Trait reth::core::primitives::Hardforks

pub trait Hardforks: Default + Clone {
    // Required methods
    fn fork<H>(&self, fork: H) -> ForkCondition
       where H: Hardfork;
    fn forks_iter(
        &self,
    ) -> impl Iterator<Item = (&(dyn Hardfork + 'static), ForkCondition)>;

    // Provided methods
    fn is_fork_active_at_timestamp<H>(&self, fork: H, timestamp: u64) -> bool
       where H: Hardfork { ... }
    fn is_fork_active_at_block<H>(&self, fork: H, block_number: u64) -> bool
       where H: Hardfork { ... }
}
Expand description

Generic trait over a set of ordered hardforks

Required Methods§

fn fork<H>(&self, fork: H) -> ForkCondition
where H: Hardfork,

Retrieves ForkCondition from fork. If fork is not present, returns ForkCondition::Never.

fn forks_iter( &self, ) -> impl Iterator<Item = (&(dyn Hardfork + 'static), ForkCondition)>

Get an iterator of all hardforks with their respective activation conditions.

Provided Methods§

fn is_fork_active_at_timestamp<H>(&self, fork: H, timestamp: u64) -> bool
where H: Hardfork,

Convenience method to check if a fork is active at a given timestamp.

fn is_fork_active_at_block<H>(&self, fork: H, block_number: u64) -> bool
where H: Hardfork,

Convenience method to check if a fork is active at a given block number.

Object Safety§

This trait is not object safe.

Implementors§