mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: make RPC cache generic over primitives (#13146)
This commit is contained in:
@ -16,6 +16,7 @@ reth-chainspec.workspace = true
|
||||
reth-ethereum-forks.workspace = true
|
||||
reth-evm.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-primitives-traits.workspace = true
|
||||
reth-revm.workspace = true
|
||||
reth-execution-errors.workspace = true
|
||||
reth-execution-types.workspace = true
|
||||
@ -63,6 +64,7 @@ std = [
|
||||
"alloy-genesis/std",
|
||||
"alloy-primitives/std",
|
||||
"revm-primitives/std",
|
||||
"reth-primitives-traits/std",
|
||||
"revm/std",
|
||||
"reth-optimism-primitives/std",
|
||||
"reth-ethereum-forks/std",
|
||||
|
||||
@ -8,7 +8,7 @@ use reth_chainspec::ChainSpec;
|
||||
use reth_execution_errors::BlockExecutionError;
|
||||
use reth_optimism_chainspec::OpChainSpec;
|
||||
use reth_optimism_forks::OpHardfork;
|
||||
use reth_primitives::BlockBody;
|
||||
use reth_primitives_traits::BlockBody;
|
||||
use revm::{
|
||||
primitives::{Bytecode, HashMap, SpecId},
|
||||
DatabaseCommit, L1BlockInfo,
|
||||
@ -32,9 +32,9 @@ const L1_BLOCK_ECOTONE_SELECTOR: [u8; 4] = hex!("440a5e20");
|
||||
/// transaction in the L2 block.
|
||||
///
|
||||
/// Returns an error if the L1 info transaction is not found, if the block is empty.
|
||||
pub fn extract_l1_info(body: &BlockBody) -> Result<L1BlockInfo, OpBlockExecutionError> {
|
||||
pub fn extract_l1_info<B: BlockBody>(body: &B) -> Result<L1BlockInfo, OpBlockExecutionError> {
|
||||
let l1_info_tx_data = body
|
||||
.transactions
|
||||
.transactions()
|
||||
.first()
|
||||
.ok_or_else(|| OpBlockExecutionError::L1BlockInfoError {
|
||||
message: "could not find l1 block info tx in the L2 block".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user