Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Move connection_filter to the network crate (#8674)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored and debris committed May 22, 2018
1 parent 84ecab0 commit ee41fa6
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ethcore/node_filter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ethcore = { path = ".."}
ethcore-network = { path = "../../util/network" }
ethcore-network-devp2p = { path = "../../util/network-devp2p" }
ethereum-types = "0.3"
log = "0.3"
Expand Down
6 changes: 4 additions & 2 deletions ethcore/node_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

extern crate ethabi;
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 lru_cache;
extern crate parking_lot;
Expand All @@ -43,7 +44,8 @@ use parking_lot::Mutex;

use ethcore::client::{BlockChainClient, BlockId};
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");

Expand Down
5 changes: 3 additions & 2 deletions ethcore/sync/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ use std::collections::{HashMap, BTreeMap};
use std::io;
use std::time::Duration;
use bytes::Bytes;
use devp2p::{NetworkService, ConnectionFilter};
use devp2p::NetworkService;
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 io::{TimerToken};
use ethcore::ethstore::ethkey::Secret;
Expand Down
4 changes: 2 additions & 2 deletions ethcore/sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ mod api;

pub use api::*;
pub use chain::{SyncStatus, SyncState};
pub use devp2p::{validate_node_url, ConnectionFilter, ConnectionDirection};
pub use network::{NonReservedPeerMode, Error, ErrorKind};
pub use devp2p::validate_node_url;
pub use network::{NonReservedPeerMode, Error, ErrorKind, ConnectionFilter, ConnectionDirection};
pub use private_tx::{PrivateTxHandler, NoopPrivateTxHandler, SimplePrivateTxHandler};
2 changes: 1 addition & 1 deletion util/network-devp2p/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use discovery::{Discovery, TableUpdates, NodeEntry};
use ip_utils::{map_external_address, select_public_address};
use path::restrict_permissions_owner;
use parking_lot::{Mutex, RwLock};
use connection_filter::{ConnectionFilter, ConnectionDirection};
use network::{ConnectionFilter, ConnectionDirection};

type Slab<T> = ::slab::Slab<T, usize>;

Expand Down
2 changes: 0 additions & 2 deletions util/network-devp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ mod discovery;
mod service;
mod node_table;
mod ip_utils;
mod connection_filter;

pub use service::NetworkService;
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use host::NetworkContext;

pub use io::TimerToken;
Expand Down
2 changes: 1 addition & 1 deletion util/network-devp2p/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use io::*;
use parking_lot::RwLock;
use std::sync::Arc;
use ansi_term::Colour;
use connection_filter::ConnectionFilter;
use network::ConnectionFilter;

struct HostHandler {
public_url: RwLock<Option<String>>
Expand Down
2 changes: 2 additions & 0 deletions util/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ extern crate snappy;
#[macro_use]
extern crate error_chain;

mod connection_filter;
mod error;

pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use io::TimerToken;
pub use error::{Error, ErrorKind, DisconnectReason};

Expand Down

0 comments on commit ee41fa6

Please sign in to comment.