Skip to content

Commit ee89251

Browse files
author
Christos KK Loverdos
committed
Remove scala.collection.immutable
1 parent 973f7ec commit ee89251

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/main/scala/io/iohk/ethereum/consensus/blocks/BlockGeneratorSkeleton.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import io.iohk.ethereum.network.p2p.messages.PV62.BlockHeaderImplicits._
1818
import io.iohk.ethereum.utils.BlockchainConfig
1919
import io.iohk.ethereum.utils.ByteUtils.or
2020

21-
import scala.collection.immutable
2221

2322
/**
2423
* This is a skeleton for a generic [[io.iohk.ethereum.consensus.blocks.BlockGenerator BlockGenerator]].
@@ -43,7 +42,8 @@ abstract class BlockGeneratorSkeleton(
4342

4443
protected val cache: AtomicReference[List[PendingBlockAndState]] = new AtomicReference(Nil)
4544

46-
protected def newBlockBody(transactions: immutable.Seq[SignedTransaction], ommers: X): BlockBody
45+
46+
protected def newBlockBody(transactions: Seq[SignedTransaction], ommers: X): BlockBody
4747

4848
protected def defaultPrepareHeader(
4949
blockNumber: BigInt,
@@ -111,9 +111,9 @@ abstract class BlockGeneratorSkeleton(
111111
protected def prepareTransactions(
112112
transactions: Seq[SignedTransaction],
113113
blockGasLimit: BigInt
114-
): immutable.Seq[SignedTransaction] = {
114+
): Seq[SignedTransaction] = {
115115

116-
val sortedTransactions: immutable.Seq[SignedTransaction] = transactions
116+
val sortedTransactions: Seq[SignedTransaction] = transactions
117117
.groupBy(_.senderAddress).values.toList
118118
.flatMap { txsFromSender =>
119119
val ordered = txsFromSender
@@ -133,7 +133,7 @@ abstract class BlockGeneratorSkeleton(
133133
.reverse
134134
.flatMap { case (_, txs) => txs }
135135

136-
val transactionsForBlock: immutable.Seq[SignedTransaction] = sortedTransactions
136+
val transactionsForBlock: Seq[SignedTransaction] = sortedTransactions
137137
.scanLeft(BigInt(0), None: Option[SignedTransaction]) { case ((accumulatedGas, _), stx) => (accumulatedGas + stx.tx.gasLimit, Some(stx)) }
138138
.collect { case (gas, Some(stx)) => (gas, stx) }
139139
.takeWhile { case (gas, _) => gas <= blockGasLimit }

src/main/scala/io/iohk/ethereum/consensus/blocks/NoOmmersBlockGenerator.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import io.iohk.ethereum.ledger.{BlockPreparationError, BlockPreparator}
66
import io.iohk.ethereum.network.p2p.messages.PV62.BlockBody
77
import io.iohk.ethereum.utils.BlockchainConfig
88

9-
import scala.collection.immutable
109

1110
abstract class NoOmmersBlockGenerator(
1211
blockchain: Blockchain,
@@ -24,7 +23,7 @@ abstract class NoOmmersBlockGenerator(
2423

2524
type X = Nil.type
2625

27-
protected def newBlockBody(transactions: immutable.Seq[SignedTransaction], ommers: Nil.type): BlockBody = {
26+
protected def newBlockBody(transactions: Seq[SignedTransaction], ommers: Nil.type): BlockBody = {
2827
BlockBody(transactions, ommers)
2928
}
3029

src/main/scala/io/iohk/ethereum/consensus/ethash/blocks/EthashBlockGenerator.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import io.iohk.ethereum.ledger.{BlockPreparationError, BlockPreparator}
1212
import io.iohk.ethereum.network.p2p.messages.PV62.BlockBody
1313
import io.iohk.ethereum.utils.BlockchainConfig
1414

15-
import scala.collection.immutable
1615

1716
/** Internal API, used for testing (especially mocks) */
1817
trait EthashBlockGenerator extends TestBlockGenerator {
@@ -39,7 +38,7 @@ class EthashBlockGeneratorImpl(
3938
blockTimestampProvider
4039
) with EthashBlockGenerator {
4140

42-
protected def newBlockBody(transactions: immutable.Seq[SignedTransaction], ommers: Ommers): BlockBody = {
41+
protected def newBlockBody(transactions: Seq[SignedTransaction], ommers: Ommers): BlockBody = {
4342
BlockBody(transactions, ommers)
4443
}
4544

0 commit comments

Comments
 (0)