dev: add requests to EthBuiltPayload (#12072)

This commit is contained in:
greged93
2024-10-26 08:10:15 +02:00
committed by GitHub
parent fa59bd512e
commit e0ad59834d
9 changed files with 36 additions and 23 deletions

View File

@ -65,7 +65,7 @@
//! },
//! ..Default::default()
//! };
//! let payload = EthBuiltPayload::new(self.attributes.id, payload.seal_slow(), U256::ZERO, None);
//! let payload = EthBuiltPayload::new(self.attributes.id, payload.seal_slow(), U256::ZERO, None, None);
//! Ok(payload)
//! }
//!

View File

@ -89,6 +89,7 @@ impl PayloadJob for TestPayloadJob {
Block::default().seal_slow(),
U256::ZERO,
Some(ExecutedBlock::default()),
Some(Default::default()),
))
}

View File

@ -20,6 +20,7 @@ reth-transaction-pool.workspace = true
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

View File

@ -1,4 +1,5 @@
use crate::{PayloadEvents, PayloadKind, PayloadTypes};
use alloy_eips::eip7685::Requests;
use alloy_primitives::{Address, B256, U256};
use alloy_rpc_types::{
engine::{PayloadAttributes as EthPayloadAttributes, PayloadId},
@ -65,6 +66,9 @@ pub trait BuiltPayload: Send + Sync + std::fmt::Debug {
fn executed_block(&self) -> Option<ExecutedBlock> {
None
}
/// Returns the EIP-7865 requests for the payload if any.
fn requests(&self) -> Option<Requests>;
}
/// This can be implemented by types that describe a currently running payload job.