feat: add NetworkProtocols trait (#5543)

This commit is contained in:
Matthias Seitz
2023-11-23 15:51:40 +01:00
committed by GitHub
parent 7c148b4120
commit 5a04931397
4 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,6 @@
//! Components that are used by the node command.
use reth_network::NetworkEvents;
use reth_network::{NetworkEvents, NetworkProtocols};
use reth_network_api::{NetworkInfo, Peers};
use reth_primitives::ChainSpec;
use reth_provider::{
@ -48,7 +48,7 @@ pub trait RethNodeComponents: Clone + Send + Sync + 'static {
/// The transaction pool type
type Pool: TransactionPool + Clone + Unpin + 'static;
/// The network type used to communicate with p2p.
type Network: NetworkInfo + Peers + NetworkEvents + Clone + 'static;
type Network: NetworkInfo + Peers + NetworkProtocols + NetworkEvents + Clone + 'static;
/// The events type used to create subscriptions.
type Events: CanonStateSubscriptions + Clone + 'static;
/// The type that is used to spawn tasks.
@ -117,7 +117,7 @@ where
Provider: FullProvider + Clone + 'static,
Tasks: TaskSpawner + Clone + Unpin + 'static,
Pool: TransactionPool + Clone + Unpin + 'static,
Network: NetworkInfo + Peers + NetworkEvents + Clone + 'static,
Network: NetworkInfo + Peers + NetworkProtocols + NetworkEvents + Clone + 'static,
Events: CanonStateSubscriptions + Clone + 'static,
{
type Provider = Provider;