Skip to content

Commit

Permalink
refac: small refactor in BlockchainProvider2 (paradigmxyz#11660)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 11, 2024
1 parent 160e4b2 commit b51299b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions crates/storage/provider/src/providers/blockchain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl<N: ProviderNodeTypes> HeaderProvider for BlockchainProvider2<N> {
{
last_finalized_num_hash.number
} else {
self.database.last_block_number()?
self.last_block_number()?
}
} else {
// Otherwise, return what we have on disk for the input block
Expand Down Expand Up @@ -841,12 +841,7 @@ impl<N: ProviderNodeTypes> BlockReader for BlockchainProvider2<N> {
id,
|db_provider| db_provider.ommers(id),
|block_state| {
if self
.database
.chain_spec()
.final_paris_total_difficulty(block_state.number())
.is_some()
{
if self.chain_spec().final_paris_total_difficulty(block_state.number()).is_some() {
return Ok(Some(Vec::new()))
}

Expand Down Expand Up @@ -1174,7 +1169,7 @@ impl<N: ProviderNodeTypes> WithdrawalsProvider for BlockchainProvider2<N> {
id: BlockHashOrNumber,
timestamp: u64,
) -> ProviderResult<Option<Withdrawals>> {
if !self.database.chain_spec().is_shanghai_active_at_timestamp(timestamp) {
if !self.chain_spec().is_shanghai_active_at_timestamp(timestamp) {
return Ok(None)
}

Expand Down Expand Up @@ -1210,7 +1205,7 @@ impl<N: ProviderNodeTypes> RequestsProvider for BlockchainProvider2<N> {
id: BlockHashOrNumber,
timestamp: u64,
) -> ProviderResult<Option<reth_primitives::Requests>> {
if !self.database.chain_spec().is_prague_active_at_timestamp(timestamp) {
if !self.chain_spec().is_prague_active_at_timestamp(timestamp) {
return Ok(None)
}

Expand Down

0 comments on commit b51299b

Please sign in to comment.