//! Payload service component for the node builder. use crate::{BuilderContext, FullNodeTypes}; use reth_payload_builder::PayloadBuilderHandle; use reth_transaction_pool::TransactionPool; use std::future::Future; /// A type that knows how to spawn the payload service. pub trait PayloadServiceBuilder: Send { /// Spawns the payload service and returns the handle to it. /// /// The [`BuilderContext`] is provided to allow access to the node's configuration. fn spawn_payload_service( self, ctx: &BuilderContext, pool: Pool, ) -> impl Future>> + Send; } impl PayloadServiceBuilder for F where Node: FullNodeTypes, Pool: TransactionPool, F: Fn(&BuilderContext, Pool) -> Fut + Send, Fut: Future>> + Send, { fn spawn_payload_service( self, ctx: &BuilderContext, pool: Pool, ) -> impl Future>> + Send { self(ctx, pool) } }