Skip to content

Commit

Permalink
[ETCM-355] scalafix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-golebiewski committed Jul 6, 2021
1 parent aa358aa commit 9f6194a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import io.iohk.ethereum.network.discovery.PeerDiscoveryManager.DiscoveredNodesIn
import io.iohk.ethereum.network.handshaker.EtcHandshaker
import io.iohk.ethereum.network.handshaker.EtcHandshakerConfiguration
import io.iohk.ethereum.network.handshaker.Handshaker
import io.iohk.ethereum.network.p2p.messages.Capability
import io.iohk.ethereum.network.rlpx.AuthHandshaker
import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration
import io.iohk.ethereum.nodebuilder.PruningConfigBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import io.iohk.ethereum.network.discovery.DiscoveryConfig
import io.iohk.ethereum.network.handshaker.EtcHandshaker
import io.iohk.ethereum.network.handshaker.EtcHandshakerConfiguration
import io.iohk.ethereum.network.handshaker.Handshaker
import io.iohk.ethereum.network.p2p.messages.Capability
import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration
import io.iohk.ethereum.nodebuilder.AuthHandshakerBuilder
import io.iohk.ethereum.nodebuilder.NodeKeyBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import io.iohk.ethereum.domain.BlockchainReader
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
import io.iohk.ethereum.network.ForkResolver
import io.iohk.ethereum.network.PeerManagerActor.PeerConfiguration
import io.iohk.ethereum.network.p2p.messages.Capability
import io.iohk.ethereum.utils.NodeStatus
import io.iohk.ethereum.utils.BlockchainConfig
import io.iohk.ethereum.utils.NodeStatus

case class EtcHandshaker private (
handshakerState: HandshakerState[PeerInfo],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package io.iohk.ethereum.network.handshaker

import io.iohk.ethereum.forkid.ForkId
import io.iohk.ethereum.network.EtcPeerManagerActor.{PeerInfo, RemoteStatus}
import io.iohk.ethereum.network.p2p.messages.{BaseETH6XMessages, ProtocolVersions, ETH64}
import io.iohk.ethereum.network.p2p.{Message, MessageSerializable}
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
import io.iohk.ethereum.network.EtcPeerManagerActor.RemoteStatus
import io.iohk.ethereum.network.p2p.Message
import io.iohk.ethereum.network.p2p.MessageSerializable
import io.iohk.ethereum.network.p2p.messages.ETH64
import io.iohk.ethereum.network.p2p.messages.ProtocolVersions

case class EthNodeStatus64ExchangeState(
handshakerConfiguration: EtcHandshakerConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package io.iohk.ethereum.network.p2p.messages

import akka.util.ByteString
import io.iohk.ethereum.domain._

import org.bouncycastle.util.encoders.Hex

import io.iohk.ethereum.forkid.ForkId
import io.iohk.ethereum.forkid.ForkId._
import io.iohk.ethereum.mpt.{MptNode, MptTraversals}
import io.iohk.ethereum.network.p2p.{Message, MessageSerializableImplicit}
import io.iohk.ethereum.network.p2p.Message
import io.iohk.ethereum.network.p2p.MessageSerializableImplicit
import io.iohk.ethereum.rlp.RLPImplicitConversions._
import io.iohk.ethereum.rlp.RLPImplicits._
import io.iohk.ethereum.rlp._
import org.bouncycastle.util.encoders.Hex

object ETH64 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ class EtcHandshakerSpec extends AnyFlatSpec with Matchers {
}

trait LocalPeerETH64Setup extends LocalPeerSetup {
val localStatusMsg = ETH64.Status(
val localStatusMsg: ETH64.Status = ETH64.Status(
protocolVersion = ProtocolVersions.ETH64.version,
networkId = Config.Network.peer.networkId,
totalDifficulty = genesisBlock.header.difficulty,
bestHash = genesisBlock.header.hash,
genesisHash = genesisBlock.header.hash,
forkId = ForkId(1L, None)
)
val localStatus = RemoteStatus(localStatusMsg)
val localStatus: RemoteStatus = RemoteStatus(localStatusMsg)
}

trait LocalPeerETC64Setup extends LocalPeerSetup {
Expand Down Expand Up @@ -436,15 +436,15 @@ class EtcHandshakerSpec extends AnyFlatSpec with Matchers {
}

trait RemotePeerETH64Setup extends RemotePeerSetup {
val remoteHello = Hello(
val remoteHello: Hello = Hello(
p2pVersion = EtcHelloExchangeState.P2pVersion,
clientId = "remote-peer",
capabilities = Seq(Eth64Capability),
listenPort = remotePort,
nodeId = ByteString(remoteNodeStatus.nodeId)
)

val remoteStatusMsg = ETH64.Status(
val remoteStatusMsg: ETH64.Status = ETH64.Status(
protocolVersion = ProtocolVersions.ETH64.version,
networkId = Config.Network.peer.networkId,
totalDifficulty = 0,
Expand All @@ -453,6 +453,6 @@ class EtcHandshakerSpec extends AnyFlatSpec with Matchers {
forkId = ForkId(2L, Some(3L))
)

val remoteStatus = RemoteStatus(remoteStatusMsg)
val remoteStatus: RemoteStatus = RemoteStatus(remoteStatusMsg)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MessagesSerializationSpec extends AnyWordSpec with ScalaCheckPropertyCheck
}

//scalastyle:off method.length
def commonEthAssertions(version: Capability) = {
def commonEthAssertions(version: Capability): Unit = {
"encoding and decoding ETH61.NewBlockHashes" should {
"throw for unsupported message version" in {
val msg = ETH61.NewBlockHashes(Seq(ByteString("23"), ByteString("10"), ByteString("36")))
Expand Down

0 comments on commit 9f6194a

Please sign in to comment.