mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-22 02:34:29 +00:00
sort imports + docs
This commit is contained in:
parent
048af975f3
commit
4af0145baa
1 changed files with 21 additions and 15 deletions
|
@ -1,36 +1,39 @@
|
||||||
use bytes::Bytes;
|
|
||||||
use futures::future::BoxFuture;
|
|
||||||
use futures::FutureExt;
|
|
||||||
use monero_serai::block::Block;
|
|
||||||
use monero_serai::transaction::Transaction;
|
|
||||||
use std::collections::HashSet;
|
|
||||||
use std::{
|
use std::{
|
||||||
|
collections::HashSet,
|
||||||
future::{ready, Ready},
|
future::{ready, Ready},
|
||||||
task::{Context, Poll},
|
task::{Context, Poll},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use bytes::Bytes;
|
||||||
|
use futures::{future::BoxFuture, FutureExt};
|
||||||
|
use monero_serai::{block::Block, transaction::Transaction};
|
||||||
use tower::{Service, ServiceExt};
|
use tower::{Service, ServiceExt};
|
||||||
|
|
||||||
use cuprate_blockchain::service::BlockchainReadHandle;
|
use cuprate_blockchain::service::BlockchainReadHandle;
|
||||||
use cuprate_consensus::transactions::new_tx_verification_data;
|
use cuprate_consensus::{transactions::new_tx_verification_data, BlockChainContextService};
|
||||||
use cuprate_consensus::BlockChainContextService;
|
|
||||||
use cuprate_fixed_bytes::ByteArrayVec;
|
use cuprate_fixed_bytes::ByteArrayVec;
|
||||||
use cuprate_helper::asynch::rayon_spawn_async;
|
use cuprate_helper::{
|
||||||
use cuprate_helper::cast::usize_to_u64;
|
asynch::rayon_spawn_async,
|
||||||
use cuprate_helper::map::{combine_low_high_bits_to_u128, split_u128_into_low_high_bits};
|
cast::usize_to_u64,
|
||||||
|
map::{combine_low_high_bits_to_u128, split_u128_into_low_high_bits},
|
||||||
|
};
|
||||||
use cuprate_p2p::constants::MAX_BLOCK_BATCH_LEN;
|
use cuprate_p2p::constants::MAX_BLOCK_BATCH_LEN;
|
||||||
use cuprate_p2p_core::{client::PeerInformation, NetworkZone, ProtocolRequest, ProtocolResponse};
|
use cuprate_p2p_core::{client::PeerInformation, NetworkZone, ProtocolRequest, ProtocolResponse};
|
||||||
use cuprate_types::blockchain::{BlockchainReadRequest, BlockchainResponse};
|
use cuprate_types::{
|
||||||
use cuprate_types::{BlockCompleteEntry, MissingTxsInBlock, TransactionBlobs};
|
blockchain::{BlockchainReadRequest, BlockchainResponse},
|
||||||
|
BlockCompleteEntry, MissingTxsInBlock, TransactionBlobs,
|
||||||
|
};
|
||||||
use cuprate_wire::protocol::{
|
use cuprate_wire::protocol::{
|
||||||
ChainRequest, ChainResponse, FluffyMissingTransactionsRequest, GetObjectsRequest,
|
ChainRequest, ChainResponse, FluffyMissingTransactionsRequest, GetObjectsRequest,
|
||||||
GetObjectsResponse, NewFluffyBlock,
|
GetObjectsResponse, NewFluffyBlock,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::blockchain::interface as blockchain_interface;
|
use crate::blockchain::interface::{self as blockchain_interface, IncomingBlockError};
|
||||||
use crate::blockchain::interface::IncomingBlockError;
|
|
||||||
|
|
||||||
|
/// The P2P protocol request handler [`MakeService`](tower::MakeService).
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct P2pProtocolRequestHandlerMaker {
|
pub struct P2pProtocolRequestHandlerMaker {
|
||||||
|
/// The [`BlockchainReadHandle`]
|
||||||
pub blockchain_read_handle: BlockchainReadHandle,
|
pub blockchain_read_handle: BlockchainReadHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,9 +58,12 @@ impl<N: NetworkZone> Service<PeerInformation<N>> for P2pProtocolRequestHandlerMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The P2P protocol request handler.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct P2pProtocolRequestHandler<N: NetworkZone> {
|
pub struct P2pProtocolRequestHandler<N: NetworkZone> {
|
||||||
|
/// The [`PeerInformation`] for this peer.
|
||||||
peer_information: PeerInformation<N>,
|
peer_information: PeerInformation<N>,
|
||||||
|
/// The [`BlockchainReadHandle`]
|
||||||
blockchain_read_handle: BlockchainReadHandle,
|
blockchain_read_handle: BlockchainReadHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue