From c5123e1ecd4039d599cd6931992b227be6f5cfc6 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 10 Feb 2020 21:22:34 +0100 Subject: [PATCH] sync: remove broken eth_protocol_version method (#11473) * sync: fix eth_protocol_version * sync: remove eth_protocol_version altogether --- ethcore/sync/src/sync_io.rs | 6 ------ ethcore/sync/src/tests/helpers.rs | 8 ++------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ethcore/sync/src/sync_io.rs b/ethcore/sync/src/sync_io.rs index b92e0cd29..f3fcfa1ee 100644 --- a/ethcore/sync/src/sync_io.rs +++ b/ethcore/sync/src/sync_io.rs @@ -54,8 +54,6 @@ pub trait SyncIo { fn peer_enode(&self, peer_id: PeerId) -> Option; /// Returns information on p2p session fn peer_session_info(&self, peer_id: PeerId) -> Option; - /// Maximum mutually supported ETH protocol version - fn eth_protocol_version(&self, peer_id: PeerId) -> u8; /// Maximum mutually supported version of a gien protocol. fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8; /// Returns if the chain block queue empty @@ -141,10 +139,6 @@ impl<'s> SyncIo for NetSyncIo<'s> { self.network.session_info(peer_id) } - fn eth_protocol_version(&self, peer_id: PeerId) -> u8 { - self.network.protocol_version(self.network.subprotocol_name(), peer_id).unwrap_or(0) - } - fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8 { self.network.protocol_version(*protocol, peer_id).unwrap_or(0) } diff --git a/ethcore/sync/src/tests/helpers.rs b/ethcore/sync/src/tests/helpers.rs index 02839f687..4ca63671d 100644 --- a/ethcore/sync/src/tests/helpers.rs +++ b/ethcore/sync/src/tests/helpers.rs @@ -155,12 +155,8 @@ impl<'p, C> SyncIo for TestIo<'p, C> where C: FlushingBlockChainClient, C: 'p { None } - fn eth_protocol_version(&self, _peer: PeerId) -> u8 { - ETH_PROTOCOL_VERSION_63.0 - } - - fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8 { - if protocol == &WARP_SYNC_PROTOCOL_ID { PAR_PROTOCOL_VERSION_4.0 } else { self.eth_protocol_version(peer_id) } + fn protocol_version(&self, protocol: &ProtocolId, _peer_id: PeerId) -> u8 { + if protocol == &WARP_SYNC_PROTOCOL_ID { PAR_PROTOCOL_VERSION_4.0 } else { ETH_PROTOCOL_VERSION_63.0 } } fn is_expired(&self) -> bool {