net: replace reth-primitive imports (#11023)

This commit is contained in:
Håvard Anda Estensen
2024-09-19 10:29:01 +02:00
committed by GitHub
parent 883975dc90
commit ae9b13f4a1
59 changed files with 139 additions and 96 deletions

View File

@ -12,6 +12,7 @@ description = "traits and commonly used types for p2p and network communication"
workspace = true
[dependencies]
# reth
reth-primitives.workspace = true
reth-eth-wire-types.workspace = true
reth-consensus.workspace = true
@ -19,6 +20,9 @@ reth-network-peers.workspace = true
reth-network-types.workspace = true
reth-storage-errors.workspace = true
# ethereum
alloy-primitives.workspace = true
# async
futures.workspace = true
tokio = { workspace = true, features = ["sync"] }

View File

@ -4,8 +4,9 @@ use std::{
};
use crate::{download::DownloadClient, error::PeerRequestResult, priority::Priority};
use alloy_primitives::B256;
use futures::{Future, FutureExt};
use reth_primitives::{BlockBody, B256};
use reth_primitives::BlockBody;
/// The bodies future type
pub type BodiesFut = Pin<Box<dyn Future<Output = PeerRequestResult<Vec<BlockBody>>> + Send + Sync>>;

View File

@ -1,7 +1,7 @@
use super::response::BlockResponse;
use crate::error::DownloadResult;
use alloy_primitives::BlockNumber;
use futures::Stream;
use reth_primitives::BlockNumber;
use std::ops::RangeInclusive;
/// Body downloader return type.

View File

@ -1,4 +1,5 @@
use reth_primitives::{BlockNumber, SealedBlock, SealedHeader, U256};
use alloy_primitives::{BlockNumber, U256};
use reth_primitives::{SealedBlock, SealedHeader};
/// The block response
#[derive(PartialEq, Eq, Debug, Clone)]

View File

@ -6,7 +6,7 @@ use crate::{
headers::client::{HeadersClient, HeadersRequest},
priority::Priority,
};
use reth_primitives::B256;
use alloy_primitives::B256;
pub use futures::future::Either;

View File

@ -1,13 +1,12 @@
use std::ops::RangeInclusive;
use super::headers::client::HeadersRequest;
use alloy_primitives::{BlockNumber, B256};
use derive_more::{Display, Error};
use reth_consensus::ConsensusError;
use reth_network_peers::WithPeerId;
use reth_network_types::ReputationChangeKind;
use reth_primitives::{
BlockHashOrNumber, BlockNumber, GotExpected, GotExpectedBoxed, Header, B256,
};
use reth_primitives::{BlockHashOrNumber, GotExpected, GotExpectedBoxed, Header};
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
use tokio::sync::{mpsc, oneshot};

View File

@ -5,10 +5,11 @@ use crate::{
headers::client::{HeadersClient, SingleHeaderRequest},
BlockClient,
};
use alloy_primitives::B256;
use reth_consensus::{Consensus, ConsensusError};
use reth_eth_wire_types::HeadersDirection;
use reth_network_peers::WithPeerId;
use reth_primitives::{BlockBody, GotExpected, Header, SealedBlock, SealedHeader, B256};
use reth_primitives::{BlockBody, GotExpected, Header, SealedBlock, SealedHeader};
use std::{
cmp::Reverse,
collections::{HashMap, VecDeque},

View File

@ -1,8 +1,9 @@
use super::error::HeadersDownloaderResult;
use crate::error::{DownloadError, DownloadResult};
use alloy_primitives::B256;
use futures::Stream;
use reth_consensus::Consensus;
use reth_primitives::{BlockHashOrNumber, SealedHeader, B256};
use reth_primitives::{BlockHashOrNumber, SealedHeader};
/// A downloader capable of fetching and yielding block headers.
///
/// A downloader represents a distinct strategy for submitting requests to download block headers,

View File

@ -4,8 +4,9 @@ use crate::{
error::PeerRequestResult,
priority::Priority,
};
use alloy_primitives::B256;
use futures::FutureExt;
use reth_primitives::{BlockBody, B256};
use reth_primitives::BlockBody;
use std::fmt::{Debug, Formatter};
use tokio::sync::oneshot;

View File

@ -5,11 +5,12 @@ use crate::{
headers::client::{HeadersClient, HeadersRequest},
priority::Priority,
};
use alloy_primitives::B256;
use parking_lot::Mutex;
use reth_eth_wire_types::HeadersDirection;
use reth_network_peers::{PeerId, WithPeerId};
use reth_primitives::{
BlockBody, BlockHashOrNumber, BlockNumHash, Header, SealedBlock, SealedHeader, B256,
BlockBody, BlockHashOrNumber, BlockNumHash, Header, SealedBlock, SealedHeader,
};
use std::{collections::HashMap, sync::Arc};