Move payload_attributes function to trait (#12427)

This commit is contained in:
Steven
2024-11-11 05:56:06 -06:00
committed by GitHub
parent 9ff80977b5
commit 56b5937691
2 changed files with 18 additions and 12 deletions

View File

@ -50,6 +50,12 @@ pub trait PayloadBuilder: Send + Sync + Unpin {
/// Sends a message to the service to subscribe to payload events.
/// Returns a receiver that will receive them.
async fn subscribe(&self) -> Result<PayloadEvents<Self::PayloadType>, Self::Error>;
/// Returns the payload attributes associated with the given identifier.
async fn payload_attributes(
&self,
id: PayloadId,
) -> Option<Result<<Self::PayloadType as PayloadTypes>::PayloadBuilderAttributes, Self::Error>>;
}
/// Represents a built payload type that contains a built [`SealedBlock`] and can be converted into