Skip to content

Commit

Permalink
feat: make BuiltPayload generic
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 committed Dec 12, 2024
1 parent 328d493 commit 94b0748
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/payload/primitives/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ use alloy_eips::{
use alloy_primitives::{Address, B256, U256};
use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
use reth_chain_state::ExecutedBlock;
use reth_primitives::SealedBlock;
use reth_primitives::{EthPrimitives, NodePrimitives, SealedBlock};

/// Represents a built payload type that contains a built [`SealedBlock`] and can be converted into
/// engine API execution payloads.
pub trait BuiltPayload: Send + Sync + std::fmt::Debug {
pub trait BuiltPayload<N: NodePrimitives = EthPrimitives>: Send + Sync + std::fmt::Debug {
/// Returns the built block (sealed)
fn block(&self) -> &SealedBlock;
fn block(&self) -> &SealedBlock<N::BlockHeader, N::BlockBody>;

/// Returns the fees collected for the built block
fn fees(&self) -> U256;

/// Returns the entire execution data for the built block, if available.
fn executed_block(&self) -> Option<ExecutedBlock> {
fn executed_block(&self) -> Option<ExecutedBlock<N>> {
None
}

Expand Down

0 comments on commit 94b0748

Please sign in to comment.