diff --git a/util/network-devp2p/src/handshake.rs b/util/network-devp2p/src/handshake.rs index a203af5b4b4..7aef4d4f0d7 100644 --- a/util/network-devp2p/src/handshake.rs +++ b/util/network-devp2p/src/handshake.rs @@ -26,7 +26,8 @@ use node_table::NodeId; use io::{IoContext, StreamToken}; use ethkey::{KeyPair, Public, Secret, recover, sign, Generator, Random}; use ethkey::crypto::{ecdh, ecies}; -use network::{Error, ErrorKind, HostInfo}; +use network::{Error, ErrorKind, HostInfo as HostInfoTrait}; +use host::HostInfo; #[derive(PartialEq, Eq, Debug)] enum HandshakeState { diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index f3446845fb1..5ccab2e4db2 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -215,19 +215,19 @@ impl HostInfo { self.nonce = keccak(&self.nonce); self.nonce } -} -impl HostInfoTrait for HostInfo { - fn id(&self) -> &NodeId { - self.keys.public() + pub(crate) fn client_version(&self) -> &str { + &self.config.client_version } - fn secret(&self) -> &Secret { + pub(crate) fn secret(&self) -> &Secret { self.keys.secret() } +} - fn client_version(&self) -> &str { - &self.config.client_version +impl HostInfoTrait for HostInfo { + fn id(&self) -> &NodeId { + self.keys.public() } } diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index 0137543fdd5..d16403cd34e 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -330,10 +330,6 @@ impl<'a, T> NetworkContext for &'a T where T: ?Sized + NetworkContext { pub trait HostInfo { /// Returns public key fn id(&self) -> &NodeId; - /// Returns secret key - fn secret(&self) -> &Secret; - /// Returns the client version. - fn client_version(&self) -> &str; } /// Network IO protocol handler. This needs to be implemented for each new subprotocol.