Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Feat/add withdrawals root #2348

Merged
merged 7 commits into from
Apr 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ethers-core/src/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ pub struct Block<TX> {
/// Base fee per unit of gas (if past London)
#[serde(rename = "baseFeePerGas")]
pub base_fee_per_gas: Option<U256>,
/// Withdrawals root hash (EIP-4895)
#[serde(rename = "withdrawalsRoot")]
#[cfg(not(feature = "celo"))]
pub withdrawals_root: Option<H256>,
merklefruit marked this conversation as resolved.
Show resolved Hide resolved

#[cfg(feature = "celo")]
#[cfg_attr(docsrs, doc(cfg(feature = "celo")))]
Expand Down Expand Up @@ -218,6 +222,7 @@ impl Block<TxHash> {
mix_hash,
nonce,
base_fee_per_gas,
withdrawals_root,
other,
..
} = self;
Expand All @@ -243,6 +248,7 @@ impl Block<TxHash> {
mix_hash,
nonce,
base_fee_per_gas,
withdrawals_root,
transactions,
other,
}
Expand Down Expand Up @@ -322,6 +328,7 @@ impl From<Block<Transaction>> for Block<TxHash> {
mix_hash,
nonce,
base_fee_per_gas,
withdrawals_root,
other,
} = full;
Block {
Expand All @@ -346,6 +353,7 @@ impl From<Block<Transaction>> for Block<TxHash> {
mix_hash,
nonce,
base_fee_per_gas,
withdrawals_root,
transactions: transactions.iter().map(|tx| tx.hash).collect(),
other,
}
Expand Down