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

Commit

Permalink
Remove HostInfo::client_version() and secret() (#8677)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored and debris committed May 22, 2018
1 parent 3fde07b commit 84ecab0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
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

0 comments on commit 84ecab0

Please sign in to comment.