From 8e681e688abbb30c206feefbddd5535f65798c51 Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:21:57 +0100 Subject: [PATCH] fix: use OpBlock alias --- crates/providers-alloy/src/l2_chain_provider.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/providers-alloy/src/l2_chain_provider.rs b/crates/providers-alloy/src/l2_chain_provider.rs index da15d47..e9080b1 100644 --- a/crates/providers-alloy/src/l2_chain_provider.rs +++ b/crates/providers-alloy/src/l2_chain_provider.rs @@ -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; @@ -130,10 +130,7 @@ impl BatchValidationProvider for AlloyL2ChainProvider { Ok(l2_block_info) } - async fn block_by_number( - &mut self, - number: u64, - ) -> Result, Self::Error> { + async fn block_by_number(&mut self, number: u64) -> Result { if let Some(block) = self.block_by_number_cache.get(&number) { return Ok(block.clone()); } @@ -146,7 +143,7 @@ impl BatchValidationProvider for AlloyL2ChainProvider { return Err(AlloyL2ChainProviderError::BlockNotFound(number)); } }; - let block: Block = 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));