Move connection_filter to the network crate (#8674)

This commit is contained in:
Pierre Krieger 2018-05-22 06:34:01 +02:00 committed by Marek Kotewicz
parent 84ecab0eaf
commit ee41fa6f30
10 changed files with 15 additions and 10 deletions

1
Cargo.lock generated
View File

@ -1805,6 +1805,7 @@ dependencies = [
"ethabi-derive 5.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 5.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.12.0", "ethcore 1.12.0",
"ethcore-io 1.12.0", "ethcore-io 1.12.0",
"ethcore-network 1.12.0",
"ethcore-network-devp2p 1.12.0", "ethcore-network-devp2p 1.12.0",
"ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kvdb-memorydb 0.1.0", "kvdb-memorydb 0.1.0",

View File

@ -8,6 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies] [dependencies]
ethcore = { path = ".."} ethcore = { path = ".."}
ethcore-network = { path = "../../util/network" }
ethcore-network-devp2p = { path = "../../util/network-devp2p" } ethcore-network-devp2p = { path = "../../util/network-devp2p" }
ethereum-types = "0.3" ethereum-types = "0.3"
log = "0.3" log = "0.3"

View File

@ -18,7 +18,8 @@
extern crate ethabi; extern crate ethabi;
extern crate ethcore; extern crate ethcore;
extern crate ethcore_network_devp2p as network; extern crate ethcore_network as network;
extern crate ethcore_network_devp2p as devp2p;
extern crate ethereum_types; extern crate ethereum_types;
extern crate lru_cache; extern crate lru_cache;
extern crate parking_lot; extern crate parking_lot;
@ -43,7 +44,8 @@ use parking_lot::Mutex;
use ethcore::client::{BlockChainClient, BlockId}; use ethcore::client::{BlockChainClient, BlockId};
use ethereum_types::{H256, Address}; use ethereum_types::{H256, Address};
use network::{NodeId, ConnectionFilter, ConnectionDirection}; use network::{ConnectionFilter, ConnectionDirection};
use devp2p::NodeId;
use_contract!(peer_set, "PeerSet", "res/peer_set.json"); use_contract!(peer_set, "PeerSet", "res/peer_set.json");

View File

@ -19,9 +19,10 @@ use std::collections::{HashMap, BTreeMap};
use std::io; use std::io;
use std::time::Duration; use std::time::Duration;
use bytes::Bytes; use bytes::Bytes;
use devp2p::{NetworkService, ConnectionFilter}; use devp2p::NetworkService;
use network::{NetworkProtocolHandler, NetworkContext, HostInfo, PeerId, ProtocolId, use network::{NetworkProtocolHandler, NetworkContext, HostInfo, PeerId, ProtocolId,
NetworkConfiguration as BasicNetworkConfiguration, NonReservedPeerMode, Error, ErrorKind}; NetworkConfiguration as BasicNetworkConfiguration, NonReservedPeerMode, Error, ErrorKind,
ConnectionFilter};
use ethereum_types::{H256, H512, U256}; use ethereum_types::{H256, H512, U256};
use io::{TimerToken}; use io::{TimerToken};
use ethcore::ethstore::ethkey::Secret; use ethcore::ethstore::ethkey::Secret;

View File

@ -74,6 +74,6 @@ mod api;
pub use api::*; pub use api::*;
pub use chain::{SyncStatus, SyncState}; pub use chain::{SyncStatus, SyncState};
pub use devp2p::{validate_node_url, ConnectionFilter, ConnectionDirection}; pub use devp2p::validate_node_url;
pub use network::{NonReservedPeerMode, Error, ErrorKind}; pub use network::{NonReservedPeerMode, Error, ErrorKind, ConnectionFilter, ConnectionDirection};
pub use private_tx::{PrivateTxHandler, NoopPrivateTxHandler, SimplePrivateTxHandler}; pub use private_tx::{PrivateTxHandler, NoopPrivateTxHandler, SimplePrivateTxHandler};

View File

@ -45,7 +45,7 @@ use discovery::{Discovery, TableUpdates, NodeEntry};
use ip_utils::{map_external_address, select_public_address}; use ip_utils::{map_external_address, select_public_address};
use path::restrict_permissions_owner; use path::restrict_permissions_owner;
use parking_lot::{Mutex, RwLock}; use parking_lot::{Mutex, RwLock};
use connection_filter::{ConnectionFilter, ConnectionDirection}; use network::{ConnectionFilter, ConnectionDirection};
type Slab<T> = ::slab::Slab<T, usize>; type Slab<T> = ::slab::Slab<T, usize>;

View File

@ -106,10 +106,8 @@ mod discovery;
mod service; mod service;
mod node_table; mod node_table;
mod ip_utils; mod ip_utils;
mod connection_filter;
pub use service::NetworkService; pub use service::NetworkService;
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use host::NetworkContext; pub use host::NetworkContext;
pub use io::TimerToken; pub use io::TimerToken;

View File

@ -21,7 +21,7 @@ use io::*;
use parking_lot::RwLock; use parking_lot::RwLock;
use std::sync::Arc; use std::sync::Arc;
use ansi_term::Colour; use ansi_term::Colour;
use connection_filter::ConnectionFilter; use network::ConnectionFilter;
struct HostHandler { struct HostHandler {
public_url: RwLock<Option<String>> public_url: RwLock<Option<String>>

View File

@ -27,8 +27,10 @@ extern crate snappy;
#[macro_use] #[macro_use]
extern crate error_chain; extern crate error_chain;
mod connection_filter;
mod error; mod error;
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use io::TimerToken; pub use io::TimerToken;
pub use error::{Error, ErrorKind, DisconnectReason}; pub use error::{Error, ErrorKind, DisconnectReason};