alloy_consensus/block/traits.rs
1use super::Block;
2use alloy_eips::eip4895::Withdrawals;
3
4/// A trait for ethereum like blocks.
5pub trait EthBlock {
6 /// Returns reference to withdrawals in the block if present
7 fn withdrawals(&self) -> Option<&Withdrawals>;
8}
9
10impl<T, H> EthBlock for Block<T, H> {
11 fn withdrawals(&self) -> Option<&Withdrawals> {
12 self.body.withdrawals.as_ref()
13 }
14}