alloy-consensus 2.0.1

Ethereum consensus interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::Block;
use alloy_eips::eip4895::Withdrawals;

/// A trait for ethereum like blocks.
pub trait EthBlock {
    /// Returns reference to withdrawals in the block if present
    fn withdrawals(&self) -> Option<&Withdrawals>;
}

impl<T, H> EthBlock for Block<T, H> {
    fn withdrawals(&self) -> Option<&Withdrawals> {
        self.body.withdrawals.as_ref()
    }
}