chore: improve deps for payload prims (#12374)

This commit is contained in:
Matthias Seitz
2024-11-07 17:56:35 +01:00
committed by GitHub
parent e911fe9ff0
commit d0baf926bf
7 changed files with 16 additions and 14 deletions

View File

@ -22,8 +22,8 @@ reth-chain-state.workspace = true
# alloy
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types = { workspace = true, features = ["engine"] }
op-alloy-rpc-types-engine.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["serde"] }
op-alloy-rpc-types-engine = { workspace = true, optional = true }
# async
async-trait.workspace = true
@ -35,3 +35,6 @@ pin-project.workspace = true
serde.workspace = true
thiserror.workspace = true
tracing.workspace = true
[features]
op = ["dep:op-alloy-rpc-types-engine"]

View File

@ -1,6 +1,7 @@
use crate::{MessageValidationKind, PayloadAttributes};
use alloy_eips::eip4895::Withdrawal;
use alloy_primitives::B256;
use alloy_rpc_types::engine::ExecutionPayload;
use alloy_rpc_types_engine::ExecutionPayload;
/// Either an [`ExecutionPayload`] or a types that implements the [`PayloadAttributes`] trait.
///
@ -39,7 +40,7 @@ where
Attributes: PayloadAttributes,
{
/// Return the withdrawals for the payload or attributes.
pub fn withdrawals(&self) -> Option<&Vec<alloy_rpc_types::Withdrawal>> {
pub fn withdrawals(&self) -> Option<&Vec<Withdrawal>> {
match self {
Self::ExecutionPayload { payload, .. } => payload.withdrawals(),
Self::PayloadAttributes(attributes) => attributes.withdrawals(),

View File

@ -1,11 +1,7 @@
use crate::{PayloadEvents, PayloadKind, PayloadTypes};
use alloy_eips::eip7685::Requests;
use alloy_eips::{eip4895::Withdrawal, eip7685::Requests};
use alloy_primitives::{Address, B256, U256};
use alloy_rpc_types::{
engine::{PayloadAttributes as EthPayloadAttributes, PayloadId},
Withdrawal,
};
use op_alloy_rpc_types_engine::OpPayloadAttributes;
use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
use reth_chain_state::ExecutedBlock;
use reth_primitives::{SealedBlock, Withdrawals};
use tokio::sync::oneshot;
@ -146,7 +142,8 @@ impl PayloadAttributes for EthPayloadAttributes {
}
}
impl PayloadAttributes for OpPayloadAttributes {
#[cfg(feature = "op")]
impl PayloadAttributes for op_alloy_rpc_types_engine::OpPayloadAttributes {
fn timestamp(&self) -> u64 {
self.payload_attributes.timestamp
}