Add Withdrawals struct (#6267)

This commit is contained in:
Thomas Coratger
2024-02-01 18:57:50 +01:00
committed by GitHub
parent cac6a5275a
commit 55fae2ca9c
28 changed files with 175 additions and 113 deletions

View File

@@ -17,7 +17,7 @@
//! ```no_run
//! # use reth_rpc_types::engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
//! # use reth_rpc_types::Withdrawal;
//! # use reth_primitives::{B256, ChainSpec, Address};
//! # use reth_primitives::{B256, ChainSpec, Address, Withdrawals};
//! # use reth_node_api::{EngineTypes, EngineApiMessageVersion, validate_version_specific_fields, AttributesValidationError, PayloadAttributes, PayloadBuilderAttributes, PayloadOrAttributes};
//! # use reth_payload_builder::{EthPayloadBuilderAttributes, EthBuiltPayload};
//! # use serde::{Deserialize, Serialize};
@@ -108,7 +108,7 @@
//! self.0.prev_randao
//! }
//!
//! fn withdrawals(&self) -> &Vec<reth_primitives::Withdrawal> {
//! fn withdrawals(&self) -> &Withdrawals {
//! &self.0.withdrawals
//! }
//! }

View File

@@ -2,7 +2,7 @@ use crate::{validate_version_specific_fields, AttributesValidationError, EngineA
use reth_primitives::{
revm::config::revm_spec_by_timestamp_after_merge,
revm_primitives::{BlobExcessGasAndPrice, BlockEnv, CfgEnv, SpecId},
Address, ChainSpec, Header, SealedBlock, B256, U256,
Address, ChainSpec, Header, SealedBlock, Withdrawals, B256, U256,
};
use reth_rpc_types::{
engine::{
@@ -72,7 +72,7 @@ pub trait PayloadBuilderAttributes: Send + Sync + std::fmt::Debug {
fn prev_randao(&self) -> B256;
/// Returns the withdrawals for the running payload job.
fn withdrawals(&self) -> &Vec<reth_primitives::Withdrawal>;
fn withdrawals(&self) -> &Withdrawals;
/// Returns the configured [CfgEnv] and [BlockEnv] for the targeted payload (that has the
/// `parent` as its parent).