Implement ExecutionPayload for OpExecutionData (#14682)

This commit is contained in:
Yohann Kazoula
2025-02-24 22:36:37 +02:00
committed by GitHub
parent 38808e174f
commit a18b0fce7c

View File

@@ -126,3 +126,30 @@ where
Self::PayloadAttributes(attributes)
}
}
#[cfg(feature = "op")]
impl ExecutionPayload for op_alloy_rpc_types_engine::OpExecutionData {
fn parent_hash(&self) -> B256 {
self.parent_hash()
}
fn block_hash(&self) -> B256 {
self.block_hash()
}
fn block_number(&self) -> u64 {
self.block_number()
}
fn withdrawals(&self) -> Option<&Vec<Withdrawal>> {
Some(&self.payload.as_v2().withdrawals)
}
fn parent_beacon_block_root(&self) -> Option<B256> {
self.sidecar.parent_beacon_block_root()
}
fn timestamp(&self) -> u64 {
self.payload.as_v2().timestamp()
}
}