mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-10 15:58:27 -05:00
feat(optimism): Implement conversion of ExecutionPayloadBaseV1 into OpNextBlockEnvAttributes (#18097)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -9324,6 +9324,7 @@ dependencies = [
|
||||
"reth-errors",
|
||||
"reth-evm",
|
||||
"reth-execution-types",
|
||||
"reth-optimism-evm",
|
||||
"reth-optimism-primitives",
|
||||
"reth-primitives-traits",
|
||||
"reth-revm",
|
||||
|
||||
@@ -13,6 +13,7 @@ workspace = true
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-optimism-primitives = { workspace = true, features = ["serde"] }
|
||||
reth-optimism-evm.workspace = true
|
||||
reth-chain-state = { workspace = true, features = ["serde"] }
|
||||
reth-primitives-traits = { workspace = true, features = ["serde"] }
|
||||
reth-execution-types = { workspace = true, features = ["serde"] }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use alloy_eips::eip4895::Withdrawal;
|
||||
use alloy_primitives::{Address, Bloom, Bytes, B256, U256};
|
||||
use alloy_rpc_types_engine::PayloadId;
|
||||
use reth_optimism_evm::OpNextBlockEnvAttributes;
|
||||
use reth_optimism_primitives::OpReceipt;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
@@ -93,3 +94,16 @@ pub struct ExecutionPayloadFlashblockDeltaV1 {
|
||||
/// The withdrawals root of the block.
|
||||
pub withdrawals_root: B256,
|
||||
}
|
||||
|
||||
impl From<ExecutionPayloadBaseV1> for OpNextBlockEnvAttributes {
|
||||
fn from(value: ExecutionPayloadBaseV1) -> Self {
|
||||
Self {
|
||||
timestamp: value.timestamp,
|
||||
suggested_fee_recipient: value.fee_recipient,
|
||||
prev_randao: value.prev_randao,
|
||||
gas_limit: value.gas_limit,
|
||||
parent_beacon_block_root: Some(value.parent_beacon_block_root),
|
||||
extra_data: value.extra_data,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user