mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: relax network blockreader trait bounds (#4079)
This commit is contained in:
@ -42,7 +42,7 @@ use reth_metrics::common::mpsc::UnboundedMeteredSender;
|
||||
use reth_net_common::bandwidth_meter::BandwidthMeter;
|
||||
use reth_network_api::ReputationChangeKind;
|
||||
use reth_primitives::{listener::EventListeners, ForkId, NodeRecord, PeerId, H256};
|
||||
use reth_provider::BlockReader;
|
||||
use reth_provider::{BlockNumReader, BlockReader};
|
||||
use reth_rpc_types::{EthProtocolInfo, NetworkStatus};
|
||||
use std::{
|
||||
net::SocketAddr,
|
||||
@ -156,7 +156,7 @@ impl<C> NetworkManager<C> {
|
||||
|
||||
impl<C> NetworkManager<C>
|
||||
where
|
||||
C: BlockReader,
|
||||
C: BlockNumReader,
|
||||
{
|
||||
/// Creates the manager of a new network.
|
||||
///
|
||||
|
||||
@ -12,13 +12,12 @@ use crate::{
|
||||
peers::{PeerAction, PeersManager},
|
||||
FetchClient,
|
||||
};
|
||||
|
||||
use reth_eth_wire::{
|
||||
capability::Capabilities, BlockHashNumber, DisconnectReason, NewBlockHashes, Status,
|
||||
};
|
||||
use reth_network_api::PeerKind;
|
||||
use reth_primitives::{ForkId, PeerId, H256};
|
||||
use reth_provider::BlockReader;
|
||||
use reth_provider::BlockNumReader;
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
net::{IpAddr, SocketAddr},
|
||||
@ -70,7 +69,7 @@ pub struct NetworkState<C> {
|
||||
|
||||
impl<C> NetworkState<C>
|
||||
where
|
||||
C: BlockReader,
|
||||
C: BlockNumReader,
|
||||
{
|
||||
/// Create a new state instance with the given params
|
||||
pub(crate) fn new(
|
||||
|
||||
@ -12,7 +12,7 @@ use reth_eth_wire::{
|
||||
DisconnectReason, EthVersion, Status,
|
||||
};
|
||||
use reth_primitives::PeerId;
|
||||
use reth_provider::BlockReader;
|
||||
use reth_provider::{BlockNumReader, BlockReader};
|
||||
use std::{
|
||||
io,
|
||||
net::SocketAddr,
|
||||
@ -77,7 +77,7 @@ pub(crate) struct Swarm<C> {
|
||||
|
||||
impl<C> Swarm<C>
|
||||
where
|
||||
C: BlockReader,
|
||||
C: BlockNumReader,
|
||||
{
|
||||
/// Configures a new swarm instance.
|
||||
pub(crate) fn new(
|
||||
|
||||
Reference in New Issue
Block a user