chore(optimism/chainspec): Remove redundant crate prefixes. (#14525)

This commit is contained in:
kustrun
2025-02-17 10:39:57 +01:00
committed by GitHub
parent fbceb2b3b6
commit f2752756db

View File

@ -94,7 +94,7 @@ impl OpChainSpecBuilder {
}
/// Remove the given fork from the spec.
pub fn without_fork(mut self, fork: reth_optimism_forks::OpHardfork) -> Self {
pub fn without_fork(mut self, fork: OpHardfork) -> Self {
self.inner = self.inner.without_fork(fork);
self
}
@ -102,17 +102,14 @@ impl OpChainSpecBuilder {
/// Enable Bedrock at genesis
pub fn bedrock_activated(mut self) -> Self {
self.inner = self.inner.paris_activated();
self.inner =
self.inner.with_fork(reth_optimism_forks::OpHardfork::Bedrock, ForkCondition::Block(0));
self.inner = self.inner.with_fork(OpHardfork::Bedrock, ForkCondition::Block(0));
self
}
/// Enable Regolith at genesis
pub fn regolith_activated(mut self) -> Self {
self = self.bedrock_activated();
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Regolith, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Regolith, ForkCondition::Timestamp(0));
self
}
@ -121,9 +118,7 @@ impl OpChainSpecBuilder {
self = self.regolith_activated();
// Canyon also activates changes from L1's Shanghai hardfork
self.inner = self.inner.with_fork(EthereumHardfork::Shanghai, ForkCondition::Timestamp(0));
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Canyon, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Canyon, ForkCondition::Timestamp(0));
self
}
@ -131,36 +126,28 @@ impl OpChainSpecBuilder {
pub fn ecotone_activated(mut self) -> Self {
self = self.canyon_activated();
self.inner = self.inner.with_fork(EthereumHardfork::Cancun, ForkCondition::Timestamp(0));
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Ecotone, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Ecotone, ForkCondition::Timestamp(0));
self
}
/// Enable Fjord at genesis
pub fn fjord_activated(mut self) -> Self {
self = self.ecotone_activated();
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Fjord, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Fjord, ForkCondition::Timestamp(0));
self
}
/// Enable Granite at genesis
pub fn granite_activated(mut self) -> Self {
self = self.fjord_activated();
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Granite, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Granite, ForkCondition::Timestamp(0));
self
}
/// Enable Holocene at genesis
pub fn holocene_activated(mut self) -> Self {
self = self.granite_activated();
self.inner = self
.inner
.with_fork(reth_optimism_forks::OpHardfork::Holocene, ForkCondition::Timestamp(0));
self.inner = self.inner.with_fork(OpHardfork::Holocene, ForkCondition::Timestamp(0));
self
}
@ -199,7 +186,7 @@ impl OpChainSpec {
impl EthChainSpec for OpChainSpec {
type Header = Header;
fn chain(&self) -> alloy_chains::Chain {
fn chain(&self) -> Chain {
self.inner.chain()
}
@ -249,13 +236,11 @@ impl EthChainSpec for OpChainSpec {
}
impl Hardforks for OpChainSpec {
fn fork<H: reth_chainspec::Hardfork>(&self, fork: H) -> reth_chainspec::ForkCondition {
fn fork<H: Hardfork>(&self, fork: H) -> ForkCondition {
self.inner.fork(fork)
}
fn forks_iter(
&self,
) -> impl Iterator<Item = (&dyn reth_chainspec::Hardfork, reth_chainspec::ForkCondition)> {
fn forks_iter(&self) -> impl Iterator<Item = (&dyn Hardfork, ForkCondition)> {
self.inner.forks_iter()
}
@ -413,7 +398,7 @@ impl OpGenesisInfo {
BaseFeeParams::new(denominator as u128, elasticity as u128),
),
(
reth_optimism_forks::OpHardfork::Canyon.boxed(),
OpHardfork::Canyon.boxed(),
BaseFeeParams::new(canyon_denominator as u128, elasticity as u128),
),
]