anvil/eth/backend/
notifications.rs

1//! Notifications emitted from the backed
2
3use alloy_consensus::Header;
4use alloy_primitives::B256;
5use futures::channel::mpsc::UnboundedReceiver;
6use std::sync::Arc;
7
8/// A notification that's emitted when a new block was imported
9#[derive(Clone, Debug)]
10pub struct NewBlockNotification {
11    /// Hash of the imported block
12    pub hash: B256,
13    /// block header
14    pub header: Arc<Header>,
15}
16
17/// Type alias for a receiver that receives [NewBlockNotification]
18pub type NewBlockNotifications = UnboundedReceiver<NewBlockNotification>;