reth_storage_api/
withdrawals.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use alloy_eips::{
    eip4895::{Withdrawal, Withdrawals},
    BlockHashOrNumber,
};
use reth_storage_errors::provider::ProviderResult;

///  Client trait for fetching [Withdrawal] related data.
#[auto_impl::auto_impl(&, Arc)]
pub trait WithdrawalsProvider: Send + Sync {
    /// Get withdrawals by block id.
    fn withdrawals_by_block(
        &self,
        id: BlockHashOrNumber,
        timestamp: u64,
    ) -> ProviderResult<Option<Withdrawals>>;

    /// Get latest withdrawal from this block or earlier .
    fn latest_withdrawal(&self) -> ProviderResult<Option<Withdrawal>>;
}