Skip to content

Commit

Permalink
feat: add helpers to consume payloadfields (#1984)
Browse files Browse the repository at this point in the history
mattsse authored Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent dc3a7fe commit fb99a1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/rpc-types-engine/src/sidecar.rs
Original file line number Diff line number Diff line change
@@ -69,11 +69,21 @@ impl ExecutionPayloadSidecar {
self.cancun.as_ref()
}

/// Consumes the type and returns the [`CancunPayloadFields`]
pub fn into_cancun(self) -> Option<CancunPayloadFields> {
self.cancun.into_inner()
}

/// Returns a reference to the [`PraguePayloadFields`].
pub const fn prague(&self) -> Option<&PraguePayloadFields> {
self.prague.as_ref()
}

/// Consumes the type and returns the [`PraguePayloadFields`].
pub fn into_prague(self) -> Option<PraguePayloadFields> {
self.prague.into_inner()
}

/// Returns the parent beacon block root, if any.
pub fn parent_beacon_block_root(&self) -> Option<B256> {
self.cancun.parent_beacon_block_root()

0 comments on commit fb99a1d

Please sign in to comment.