reth_node_builder/
aliases.rs

1use reth_network::NetworkPrimitives;
2use reth_node_api::BlockBody;
3use reth_provider::BlockReader;
4
5/// This is a type alias to make type bounds simpler, when we have a [`NetworkPrimitives`] and need
6/// a [`BlockReader`] whose associated types match the [`NetworkPrimitives`] associated types.
7pub trait BlockReaderFor<N: NetworkPrimitives>:
8    BlockReader<
9    Block = N::Block,
10    Header = N::BlockHeader,
11    Transaction = <N::BlockBody as BlockBody>::Transaction,
12    Receipt = N::Receipt,
13>
14{
15}
16
17impl<N, T> BlockReaderFor<N> for T
18where
19    N: NetworkPrimitives,
20    T: BlockReader<
21        Block = N::Block,
22        Header = N::BlockHeader,
23        Transaction = <N::BlockBody as BlockBody>::Transaction,
24        Receipt = N::Receipt,
25    >,
26{
27}