feat: expose PendingPayload from reth-basic-payload-builder (#7946)

This commit is contained in:
Alex Stokes
2024-04-29 05:34:11 -06:00
committed by GitHub
parent 1fbcdeb065
commit 0501a43711

View File

@ -581,13 +581,23 @@ where
/// A future that resolves to the result of the block building job.
#[derive(Debug)]
struct PendingPayload<P> {
pub struct PendingPayload<P> {
/// The marker to cancel the job on drop
_cancel: Cancelled,
/// The channel to send the result to.
payload: oneshot::Receiver<Result<BuildOutcome<P>, PayloadBuilderError>>,
}
impl<P> PendingPayload<P> {
/// Constructs a `PendingPayload` future.
pub fn new(
cancel: Cancelled,
payload: oneshot::Receiver<Result<BuildOutcome<P>, PayloadBuilderError>>,
) -> Self {
Self { _cancel: cancel, payload }
}
}
impl<P> Future for PendingPayload<P> {
type Output = Result<BuildOutcome<P>, PayloadBuilderError>;