Trait PayloadBuilderAttributes
pub trait PayloadBuilderAttributes:
Send
+ Sync
+ Debug {
type RpcPayloadAttributes;
type Error: Error;
// Required methods
fn try_new(
parent: FixedBytes<32>,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>
where Self: Sized;
fn payload_id(&self) -> PayloadId;
fn parent(&self) -> FixedBytes<32>;
fn timestamp(&self) -> u64;
fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>;
fn suggested_fee_recipient(&self) -> Address;
fn prev_randao(&self) -> FixedBytes<32>;
fn withdrawals(&self) -> &Withdrawals;
}
Expand description
This can be implemented by types that describe a currently running payload job.
This is used as a conversion type, transforming a payload attributes type that the engine API receives, into a type that the payload builder can use.
Required Associated Types§
type RpcPayloadAttributes
type RpcPayloadAttributes
The payload attributes that can be used to construct this type. Used as the argument in
PayloadBuilderAttributes::try_new
.
type Error: Error
type Error: Error
The error type used in PayloadBuilderAttributes::try_new
.
Required Methods§
fn try_new(
parent: FixedBytes<32>,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>where
Self: Sized,
fn try_new(
parent: FixedBytes<32>,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>where
Self: Sized,
Creates a new payload builder for the given parent block and the attributes.
Derives the unique [PayloadId
] for the given parent, attributes and version.
fn payload_id(&self) -> PayloadId
fn payload_id(&self) -> PayloadId
Returns the [PayloadId
] for the running payload job.
fn parent(&self) -> FixedBytes<32>
fn parent(&self) -> FixedBytes<32>
Returns the parent block hash for the running payload job.
fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>
fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>
Returns the parent beacon block root for the running payload job, if it exists.
fn suggested_fee_recipient(&self) -> Address
fn suggested_fee_recipient(&self) -> Address
Returns the suggested fee recipient for the running payload job.
fn prev_randao(&self) -> FixedBytes<32>
fn prev_randao(&self) -> FixedBytes<32>
Returns the prevrandao field for the running payload job.
fn withdrawals(&self) -> &Withdrawals
fn withdrawals(&self) -> &Withdrawals
Returns the withdrawals for the running payload job.
Implementations on Foreign Types§
§impl PayloadBuilderAttributes for EthPayloadBuilderAttributes
impl PayloadBuilderAttributes for EthPayloadBuilderAttributes
§fn try_new(
parent: FixedBytes<32>,
attributes: PayloadAttributes,
_version: u8,
) -> Result<EthPayloadBuilderAttributes, Infallible>
fn try_new( parent: FixedBytes<32>, attributes: PayloadAttributes, _version: u8, ) -> Result<EthPayloadBuilderAttributes, Infallible>
Creates a new payload builder for the given parent block and the attributes.
Derives the unique [PayloadId
] for the given parent and attributes