From 1f8d1f8399003449ad117f8592453c33a770f711 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Sun, 23 Jun 2024 17:32:55 -0400 Subject: [PATCH] crate import fixes --- p2p/p2p-core/src/client.rs | 3 +-- p2p/p2p/src/block_downloader.rs | 6 +++--- p2p/p2p/src/block_downloader/block_queue.rs | 4 ++-- p2p/p2p/src/block_downloader/chain_tracker.rs | 6 +++--- p2p/p2p/src/block_downloader/download_batch.rs | 6 +++--- p2p/p2p/src/block_downloader/request_chain.rs | 4 ++-- p2p/p2p/src/block_downloader/tests.rs | 8 ++++---- p2p/p2p/src/lib.rs | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/p2p/p2p-core/src/client.rs b/p2p/p2p-core/src/client.rs index fb856b3..0e81d96 100644 --- a/p2p/p2p-core/src/client.rs +++ b/p2p/p2p-core/src/client.rs @@ -14,7 +14,7 @@ use tower::{Service, ServiceExt}; use tracing::Instrument; use cuprate_helper::asynch::InfallibleOneshotReceiver; -use monero_pruning::PruningSeed; +use cuprate_pruning::PruningSeed; use crate::{ handles::{ConnectionGuard, ConnectionHandle}, @@ -27,7 +27,6 @@ pub mod handshaker; mod timeout_monitor; pub use connector::{ConnectRequest, Connector}; -use cuprate_pruning::PruningSeed; pub use handshaker::{DoHandshakeRequest, HandShaker, HandshakeError}; /// An internal identifier for a given peer, will be their address if known diff --git a/p2p/p2p/src/block_downloader.rs b/p2p/p2p/src/block_downloader.rs index 3f7f7e7..81d15bf 100644 --- a/p2p/p2p/src/block_downloader.rs +++ b/p2p/p2p/src/block_downloader.rs @@ -21,13 +21,13 @@ use tokio::{ use tower::{Service, ServiceExt}; use tracing::{instrument, Instrument, Span}; -use async_buffer::{BufferAppender, BufferStream}; -use monero_p2p::{ +use cuprate_async_buffer::{BufferAppender, BufferStream}; +use cuprate_p2p_core::{ handles::ConnectionHandle, services::{PeerSyncRequest, PeerSyncResponse}, NetworkZone, PeerSyncSvc, }; -use monero_pruning::{PruningSeed, CRYPTONOTE_MAX_BLOCK_HEIGHT}; +use cuprate_pruning::{PruningSeed, CRYPTONOTE_MAX_BLOCK_HEIGHT}; use crate::{ client_pool::{ClientPool, ClientPoolDropGuard}, diff --git a/p2p/p2p/src/block_downloader/block_queue.rs b/p2p/p2p/src/block_downloader/block_queue.rs index ada2825..143ab6d 100644 --- a/p2p/p2p/src/block_downloader/block_queue.rs +++ b/p2p/p2p/src/block_downloader/block_queue.rs @@ -1,6 +1,6 @@ use std::{cmp::Ordering, collections::BinaryHeap}; -use async_buffer::BufferAppender; +use cuprate_async_buffer::BufferAppender; use super::{BlockBatch, BlockDownloadError}; @@ -120,7 +120,7 @@ mod tests { use tokio::sync::Semaphore; use tokio_test::block_on; - use monero_p2p::handles::HandleBuilder; + use cuprate_p2p_core::handles::HandleBuilder; use super::*; diff --git a/p2p/p2p/src/block_downloader/chain_tracker.rs b/p2p/p2p/src/block_downloader/chain_tracker.rs index 07bad7b..786a0de 100644 --- a/p2p/p2p/src/block_downloader/chain_tracker.rs +++ b/p2p/p2p/src/block_downloader/chain_tracker.rs @@ -1,9 +1,9 @@ use std::{cmp::min, collections::VecDeque}; -use fixed_bytes::ByteArrayVec; +use cuprate_fixed_bytes::ByteArrayVec; -use monero_p2p::{client::InternalPeerID, handles::ConnectionHandle, NetworkZone}; -use monero_pruning::{PruningSeed, CRYPTONOTE_MAX_BLOCK_HEIGHT}; +use cuprate_p2p_core::{client::InternalPeerID, handles::ConnectionHandle, NetworkZone}; +use cuprate_pruning::{PruningSeed, CRYPTONOTE_MAX_BLOCK_HEIGHT}; use crate::constants::MEDIUM_BAN; diff --git a/p2p/p2p/src/block_downloader/download_batch.rs b/p2p/p2p/src/block_downloader/download_batch.rs index 8cdde41..e9dfcb4 100644 --- a/p2p/p2p/src/block_downloader/download_batch.rs +++ b/p2p/p2p/src/block_downloader/download_batch.rs @@ -6,10 +6,10 @@ use tokio::time::timeout; use tower::{Service, ServiceExt}; use tracing::instrument; +use cuprate_fixed_bytes::ByteArrayVec; use cuprate_helper::asynch::rayon_spawn_async; -use fixed_bytes::ByteArrayVec; -use monero_p2p::{handles::ConnectionHandle, NetworkZone, PeerRequest, PeerResponse}; -use monero_wire::protocol::{GetObjectsRequest, GetObjectsResponse}; +use cuprate_p2p_core::{handles::ConnectionHandle, NetworkZone, PeerRequest, PeerResponse}; +use cuprate_wire::protocol::{GetObjectsRequest, GetObjectsResponse}; use crate::{ block_downloader::{BlockBatch, BlockDownloadError, BlockDownloadTaskResponse}, diff --git a/p2p/p2p/src/block_downloader/request_chain.rs b/p2p/p2p/src/block_downloader/request_chain.rs index 7733aef..f8b5319 100644 --- a/p2p/p2p/src/block_downloader/request_chain.rs +++ b/p2p/p2p/src/block_downloader/request_chain.rs @@ -6,13 +6,13 @@ use tokio::{task::JoinSet, time::timeout}; use tower::{Service, ServiceExt}; use tracing::{instrument, Instrument, Span}; -use monero_p2p::{ +use cuprate_p2p_core::{ client::InternalPeerID, handles::ConnectionHandle, services::{PeerSyncRequest, PeerSyncResponse}, NetworkZone, PeerRequest, PeerResponse, PeerSyncSvc, }; -use monero_wire::protocol::{ChainRequest, ChainResponse}; +use cuprate_wire::protocol::{ChainRequest, ChainResponse}; use crate::{ block_downloader::{ diff --git a/p2p/p2p/src/block_downloader/tests.rs b/p2p/p2p/src/block_downloader/tests.rs index 24360ae..cf64a76 100644 --- a/p2p/p2p/src/block_downloader/tests.rs +++ b/p2p/p2p/src/block_downloader/tests.rs @@ -18,15 +18,15 @@ use proptest::{collection::vec, prelude::*}; use tokio::{sync::Semaphore, time::timeout}; use tower::{service_fn, Service}; -use fixed_bytes::ByteArrayVec; -use monero_p2p::{ +use cuprate_fixed_bytes::ByteArrayVec; +use cuprate_p2p_core::{ client::{mock_client, Client, InternalPeerID, PeerInformation}, network_zones::ClearNet, services::{PeerSyncRequest, PeerSyncResponse}, ConnectionDirection, NetworkZone, PeerRequest, PeerResponse, }; -use monero_pruning::PruningSeed; -use monero_wire::{ +use cuprate_pruning::PruningSeed; +use cuprate_wire::{ common::{BlockCompleteEntry, TransactionBlobs}, protocol::{ChainResponse, GetObjectsResponse}, }; diff --git a/p2p/p2p/src/lib.rs b/p2p/p2p/src/lib.rs index ee0b2de..95154ec 100644 --- a/p2p/p2p/src/lib.rs +++ b/p2p/p2p/src/lib.rs @@ -4,7 +4,7 @@ //! a certain [`NetworkZone`] use std::sync::Arc; -use async_buffer::BufferStream; +use cuprate_async_buffer::BufferStream; use futures::FutureExt; use tokio::{ sync::{mpsc, watch},