Skip to content

Commit

Permalink
fix: use OpBlock alias
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Jan 16, 2025
1 parent 19d28a7 commit 8e681e6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/providers-alloy/src/l2_chain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use kona_derive::{
use lru::LruCache;
use maili_genesis::{RollupConfig, SystemConfig};
use maili_protocol::{to_system_config, BatchValidationProvider, L2BlockInfo};
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_consensus::{OpBlock, OpTxEnvelope};
use std::{boxed::Box, num::NonZeroUsize, sync::Arc};

const CACHE_SIZE: usize = 16;
Expand Down Expand Up @@ -130,10 +130,7 @@ impl BatchValidationProvider for AlloyL2ChainProvider {
Ok(l2_block_info)
}

async fn block_by_number(
&mut self,
number: u64,
) -> Result<Block<Self::Transaction>, Self::Error> {
async fn block_by_number(&mut self, number: u64) -> Result<OpBlock, Self::Error> {
if let Some(block) = self.block_by_number_cache.get(&number) {
return Ok(block.clone());
}
Expand All @@ -146,7 +143,7 @@ impl BatchValidationProvider for AlloyL2ChainProvider {
return Err(AlloyL2ChainProviderError::BlockNotFound(number));
}
};
let block: Block<Self::Transaction> = match Block::decode(&mut raw_block.as_ref()) {
let block = match OpBlock::decode(&mut raw_block.as_ref()) {
Ok(b) => b,
Err(_) => {
return Err(AlloyL2ChainProviderError::OpBlockDecode(number));
Expand Down

0 comments on commit 8e681e6

Please sign in to comment.