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

Remove HostInfo::client_version() and secret() #8677

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion util/network-devp2p/src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions util/network-devp2p/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
4 changes: 0 additions & 4 deletions util/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down