mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: make BuiltPayload generic (#13337)
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user