Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Feb 20, 2025
1 parent 211236d commit 35221cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions crates/bin/src/commands/run_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ impl RunFileCommand {
BlockWitness as _,
chainspec::{Chain, get_chain_spec_or_build},
ext::{BlockWitnessChunkExt, BlockWitnessExt},
hardforks::{ForkCondition, ScrollHardfork},
types::{BlockWitness, ChunkInfoBuilder},
},
trie::BlockWitnessTrieExt,
Expand All @@ -77,10 +76,15 @@ impl RunFileCommand {
.collect::<Result<Vec<_>, _>>()?;

let chain_id = witnesses[0].chain_id;
let chain_spec = get_chain_spec_or_build(Chain::from_id(chain_id), |spec| {
spec.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
let chain_spec = get_chain_spec_or_build(Chain::from_id(chain_id), |_spec| {
#[cfg(feature = "scroll")]
{
use sbv::primitives::hardforks::{ForkCondition, ScrollHardfork};
_spec
.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
}
});

let mut chunk_info_builder = ChunkInfoBuilder::new(&chain_spec, &blocks);
Expand Down
14 changes: 9 additions & 5 deletions crates/bin/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use sbv::{
BlockWitness,
chainspec::{Chain, get_chain_spec_or_build},
ext::BlockWitnessExt,
hardforks::{ForkCondition, ScrollHardfork},
},
trie::BlockWitnessTrieExt,
};
Expand All @@ -31,10 +30,15 @@ fn verify_inner<T: BlockWitness + BlockWitnessTrieExt + BlockWitnessExt>(
.build()
.unwrap();

let chain_spec = get_chain_spec_or_build(Chain::from_id(witness.chain_id()), |spec| {
spec.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
let chain_spec = get_chain_spec_or_build(Chain::from_id(witness.chain_id()), |_spec| {
#[cfg(feature = "scroll")]
{
use sbv::primitives::hardforks::{ForkCondition, ScrollHardfork};
_spec
.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
}
});

let mut code_db = NoHashMap::default();
Expand Down

0 comments on commit 35221cc

Please sign in to comment.