Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consensus: use Withdrawals wrapper in BlockBody #1525

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Changes from all 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: 4 additions & 4 deletions crates/consensus/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::Header;
use alloc::vec::Vec;
use alloy_eips::eip4895::Withdrawal;
use alloy_eips::eip4895::Withdrawals;
use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};

/// Ethereum full block.
Expand Down Expand Up @@ -31,7 +31,7 @@ pub struct BlockBody<T> {
/// Ommers/uncles header.
pub ommers: Vec<Header>,
/// Block withdrawals.
pub withdrawals: Option<Vec<Withdrawal>>,
pub withdrawals: Option<Withdrawals>,
}

/// We need to implement RLP traits manually because we currently don't have a way to flatten
Expand All @@ -45,7 +45,7 @@ mod block_rlp {
header: Header,
transactions: Vec<T>,
ommers: Vec<Header>,
withdrawals: Option<Vec<Withdrawal>>,
withdrawals: Option<Withdrawals>,
}

#[derive(RlpEncodable)]
Expand All @@ -54,7 +54,7 @@ mod block_rlp {
header: &'a Header,
transactions: &'a Vec<T>,
ommers: &'a Vec<Header>,
withdrawals: Option<&'a Vec<Withdrawal>>,
withdrawals: Option<&'a Withdrawals>,
}

impl<'a, T> From<&'a Block<T>> for HelperRef<'a, T> {
Expand Down