pub struct OpExecutionData {
pub payload: OpExecutionPayload,
pub sidecar: OpExecutionPayloadSidecar,
}
rpc-types-engine
only.Expand description
Struct aggregating OpExecutionPayload
and OpExecutionPayloadSidecar
and encapsulating
complete payload supplied for execution.
Fields§
§payload: OpExecutionPayload
Execution payload.
sidecar: OpExecutionPayloadSidecar
Additional fork-specific fields.
Implementations§
Source§impl OpExecutionData
impl OpExecutionData
Sourcepub const fn new(
payload: OpExecutionPayload,
sidecar: OpExecutionPayloadSidecar,
) -> OpExecutionData
pub const fn new( payload: OpExecutionPayload, sidecar: OpExecutionPayloadSidecar, ) -> OpExecutionData
Creates new instance of OpExecutionData
.
Sourcepub fn from_block_slow<T, H>(block: &Block<T, H>) -> OpExecutionData
pub fn from_block_slow<T, H>(block: &Block<T, H>) -> OpExecutionData
Conversion from alloy_consensus::Block
. Also returns the OpExecutionPayloadSidecar
extracted from the block.
See also from_block_unchecked
.
Note: This re-calculates the block hash.
Sourcepub fn from_block_unchecked<T, H>(
block_hash: FixedBytes<32>,
block: &Block<T, H>,
) -> OpExecutionData
pub fn from_block_unchecked<T, H>( block_hash: FixedBytes<32>, block: &Block<T, H>, ) -> OpExecutionData
Conversion from alloy_consensus::Block
. Also returns the OpExecutionPayloadSidecar
extracted from the block.
See also OpExecutionPayload::from_block_unchecked
.
Sourcepub fn v2(payload: ExecutionPayloadInputV2) -> OpExecutionData
pub fn v2(payload: ExecutionPayloadInputV2) -> OpExecutionData
Creates a new instance from args to engine API method newPayloadV2
.
Spec: https://specs.optimism.io/protocol/exec-engine.html#engine_newpayloadv2
Sourcepub fn v3(
payload: ExecutionPayloadV3,
versioned_hashes: Vec<FixedBytes<32>>,
parent_beacon_block_root: FixedBytes<32>,
) -> OpExecutionData
pub fn v3( payload: ExecutionPayloadV3, versioned_hashes: Vec<FixedBytes<32>>, parent_beacon_block_root: FixedBytes<32>, ) -> OpExecutionData
Creates a new instance from args to engine API method newPayloadV3
.
Spec: https://specs.optimism.io/protocol/exec-engine.html#engine_newpayloadv3
Sourcepub fn v4(
payload: OpExecutionPayloadV4,
versioned_hashes: Vec<FixedBytes<32>>,
parent_beacon_block_root: FixedBytes<32>,
execution_requests: Requests,
) -> OpExecutionData
pub fn v4( payload: OpExecutionPayloadV4, versioned_hashes: Vec<FixedBytes<32>>, parent_beacon_block_root: FixedBytes<32>, execution_requests: Requests, ) -> OpExecutionData
Creates a new instance from args to engine API method newPayloadV4
.
Spec: https://specs.optimism.io/protocol/exec-engine.html#engine_newpayloadv4
Sourcepub fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>
pub fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>
Returns the parent beacon block root, if any.
Sourcepub const fn withdrawals(&self) -> Option<&Vec<Withdrawal>>
pub const fn withdrawals(&self) -> Option<&Vec<Withdrawal>>
Return the withdrawals for the payload or attributes.
Sourcepub const fn parent_hash(&self) -> FixedBytes<32>
pub const fn parent_hash(&self) -> FixedBytes<32>
Returns the parent hash of the block.
Sourcepub const fn block_hash(&self) -> FixedBytes<32>
pub const fn block_hash(&self) -> FixedBytes<32>
Returns the hash of the block.
Sourcepub const fn block_number(&self) -> u64
pub const fn block_number(&self) -> u64
Returns the number of the block.
Trait Implementations§
Source§impl Clone for OpExecutionData
impl Clone for OpExecutionData
Source§fn clone(&self) -> OpExecutionData
fn clone(&self) -> OpExecutionData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OpExecutionData
impl Debug for OpExecutionData
Source§impl<'de> Deserialize<'de> for OpExecutionData
impl<'de> Deserialize<'de> for OpExecutionData
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpExecutionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpExecutionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for OpExecutionData
impl Serialize for OpExecutionData
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl !Freeze for OpExecutionData
impl RefUnwindSafe for OpExecutionData
impl Send for OpExecutionData
impl Sync for OpExecutionData
impl Unpin for OpExecutionData
impl UnwindSafe for OpExecutionData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more