sync: remove broken eth_protocol_version method (#11473)

* sync: fix eth_protocol_version

* sync: remove eth_protocol_version altogether
This commit is contained in:
Andronik Ordian 2020-02-10 21:22:34 +01:00 committed by GitHub
parent 99271db9d3
commit c5123e1ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View File

@ -54,8 +54,6 @@ pub trait SyncIo {
fn peer_enode(&self, peer_id: PeerId) -> Option<String>;
/// Returns information on p2p session
fn peer_session_info(&self, peer_id: PeerId) -> Option<SessionInfo>;
/// 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)
}

View File

@ -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 {