diff --git a/build.sbt b/build.sbt index 3f4ca47d1..415b9c189 100644 --- a/build.sbt +++ b/build.sbt @@ -98,20 +98,21 @@ val loggingDependencies = Seq( "ch.qos.logback" % "logback-classic" % "1.3.0-alpha4" ) -val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.1.6" +val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.1.8" val testingDependencies = Seq( "com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test", "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test", "org.scalactic" %% "scalactic" % "3.0.3" % "test", - "org.scalatest" %% "scalatest" % "3.0.3" % "test", - "org.scalacheck" %% "scalacheck" % "1.13.+", + "org.scalatest" %% "scalatest" % "3.1.1" % "test", + "org.scalacheck" %% "scalacheck" % "1.14.+", + "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test, scorexUtil, (scorexUtil % Test).classifier("tests") ) libraryDependencies ++= Seq( "com.iheart" %% "ficus" % "1.4.2", - "org.scorexfoundation" %% "scrypto" % "2.1.7", + "org.scorexfoundation" %% "scrypto" % "2.1.10", scorexUtil ) ++ networkDependencies ++ apiDependencies ++ loggingDependencies ++ testingDependencies diff --git a/examples/build.sbt b/examples/build.sbt index 7c1f79f12..5ea04f2dc 100644 --- a/examples/build.sbt +++ b/examples/build.sbt @@ -2,8 +2,9 @@ name := "scorex-examples" libraryDependencies ++= Seq( "org.scalactic" %% "scalactic" % "3.0.1" % "test", - "org.scalatest" %% "scalatest" % "3.0.1" % "test", - "org.scalacheck" %% "scalacheck" % "1.13.+" % "test", + "org.scalatest" %% "scalatest" % "3.1.1" % "test", + "org.scalacheck" %% "scalacheck" % "1.14.+" % "test", + "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test, "org.scorexfoundation" %% "iodb" % "0.3.2", "com.typesafe.akka" %% "akka-testkit" % "2.4.17" % "test" ) diff --git a/examples/src/test/scala/hybrid/history/HybridHistorySpecification.scala b/examples/src/test/scala/hybrid/history/HybridHistorySpecification.scala index 29440f1d6..9f6411996 100644 --- a/examples/src/test/scala/hybrid/history/HybridHistorySpecification.scala +++ b/examples/src/test/scala/hybrid/history/HybridHistorySpecification.scala @@ -3,17 +3,17 @@ package hybrid.history import examples.hybrid.history.{HybridHistory, HybridSyncInfo} import hybrid.HybridGenerators import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} -import scorex.core.consensus.History.{Equal, HistoryComparisonResult, Older, Younger} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import scorex.core.consensus.History.{Older, HistoryComparisonResult, Equal, Younger} import scorex.core.utils.ScorexEncoding import scorex.core.ModifierTypeId import scorex.util.ModifierId @SuppressWarnings(Array("org.wartremover.warts.TraversableOps", "org.wartremover.warts.OptionPartial")) -class HybridHistorySpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class HybridHistorySpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators with ScorexEncoding { diff --git a/examples/src/test/scala/hybrid/history/IODBSpecification.scala b/examples/src/test/scala/hybrid/history/IODBSpecification.scala index e86275892..c10b27eec 100644 --- a/examples/src/test/scala/hybrid/history/IODBSpecification.scala +++ b/examples/src/test/scala/hybrid/history/IODBSpecification.scala @@ -5,15 +5,16 @@ import examples.hybrid.blocks.{HybridBlock, PosBlock, PowBlock} import hybrid.HybridGenerators import io.iohk.iodb.{ByteArrayWrapper, LSMStore} import org.scalacheck.Gen -import org.scalatest.prop.GeneratorDrivenPropertyChecks -import org.scalatest.{Matchers, Outcome, fixture} +import org.scalatest.matchers.should.Matchers +import org.scalatest.{fixture, Outcome} +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.utils.ScorexEncoding import scorex.testkit.utils.FileUtils import scorex.util.ModifierId @SuppressWarnings(Array("org.wartremover.warts.TraversableOps")) class IODBSpecification extends fixture.PropSpec - with GeneratorDrivenPropertyChecks + with ScalaCheckPropertyChecks with Matchers with HybridGenerators with FileUtils diff --git a/examples/src/test/scala/hybrid/primitives/PrivateKey25519Suite.scala b/examples/src/test/scala/hybrid/primitives/PrivateKey25519Suite.scala index 54fd96467..95fcb81b7 100644 --- a/examples/src/test/scala/hybrid/primitives/PrivateKey25519Suite.scala +++ b/examples/src/test/scala/hybrid/primitives/PrivateKey25519Suite.scala @@ -2,14 +2,14 @@ package hybrid.primitives import examples.commons.PublicKey25519NoncedBox import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.state.PrivateKey25519Companion @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) -class PrivateKey25519Suite extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class PrivateKey25519Suite extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/hybrid/serialization/SerializationTests.scala b/examples/src/test/scala/hybrid/serialization/SerializationTests.scala index b08b43cb7..fa93ab6e7 100644 --- a/examples/src/test/scala/hybrid/serialization/SerializationTests.scala +++ b/examples/src/test/scala/hybrid/serialization/SerializationTests.scala @@ -4,15 +4,15 @@ import examples.commons.{PublicKey25519NoncedBox, PublicKey25519NoncedBoxSeriali import examples.hybrid.blocks.{PosBlock, PosBlockSerializer, PowBlock, PowBlockSerializer} import examples.hybrid.history.{HybridSyncInfo, HybridSyncInfoSerializer} import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.box.proposition.PublicKey25519Proposition import scorex.core.transaction.wallet.{WalletBox, WalletBoxSerializer} @SuppressWarnings(Array("org.wartremover.warts.TraversableOps")) -class SerializationTests extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SerializationTests extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/hybrid/state/HBoxStoredStateSpecification.scala b/examples/src/test/scala/hybrid/state/HBoxStoredStateSpecification.scala index 9a0326c1f..ccaf4ec93 100644 --- a/examples/src/test/scala/hybrid/state/HBoxStoredStateSpecification.scala +++ b/examples/src/test/scala/hybrid/state/HBoxStoredStateSpecification.scala @@ -3,15 +3,15 @@ package hybrid.state import examples.hybrid.blocks.HybridBlock import examples.hybrid.state.HBoxStoredState import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.state.{Insertion, Removal} import scorex.testkit.properties.state.StateTests @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) -class HBoxStoredStateSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class HBoxStoredStateSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators with StateTests[HybridBlock, HBoxStoredState] { diff --git a/examples/src/test/scala/hybrid/state/SimpleBoxTransactionSpecification.scala b/examples/src/test/scala/hybrid/state/SimpleBoxTransactionSpecification.scala index 4e8ae6b6d..2ffa7c1f9 100644 --- a/examples/src/test/scala/hybrid/state/SimpleBoxTransactionSpecification.scala +++ b/examples/src/test/scala/hybrid/state/SimpleBoxTransactionSpecification.scala @@ -3,8 +3,9 @@ package hybrid.state import examples.commons.{Nonce, PublicKey25519NoncedBox, SimpleBoxTransaction, Value} import examples.hybrid.state.HBoxStoredState import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.box.proposition.PublicKey25519Proposition import scorex.core.transaction.proof.{Signature25519, Signature25519Serializer} import scorex.core.transaction.state.PrivateKey25519Companion @@ -13,9 +14,8 @@ import scorex.crypto.hash.Sha256 import scorex.crypto.signatures.{PublicKey, Signature} @SuppressWarnings(Array("org.wartremover.warts.TraversableOps")) -class SimpleBoxTransactionSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SimpleBoxTransactionSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/hybrid/transaction/TransactionSuite.scala b/examples/src/test/scala/hybrid/transaction/TransactionSuite.scala index 4d8360ac5..2f4670f92 100644 --- a/examples/src/test/scala/hybrid/transaction/TransactionSuite.scala +++ b/examples/src/test/scala/hybrid/transaction/TransactionSuite.scala @@ -3,14 +3,14 @@ package hybrid.transaction import examples.commons.SimpleBoxTransaction import hybrid.HybridGenerators import io.iohk.iodb.ByteArrayWrapper -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.state.PrivateKey25519Companion -class TransactionSuite extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class TransactionSuite extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/hybrid/validation/SemanticBlockValidatorSpecification.scala b/examples/src/test/scala/hybrid/validation/SemanticBlockValidatorSpecification.scala index 01ebc0754..8d4690564 100644 --- a/examples/src/test/scala/hybrid/validation/SemanticBlockValidatorSpecification.scala +++ b/examples/src/test/scala/hybrid/validation/SemanticBlockValidatorSpecification.scala @@ -2,14 +2,14 @@ package hybrid.validation import examples.hybrid.validation.SemanticBlockValidator import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.crypto.hash.Blake2b256 -class SemanticBlockValidatorSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SemanticBlockValidatorSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/hybrid/wallet/HWalletSpecification.scala b/examples/src/test/scala/hybrid/wallet/HWalletSpecification.scala index a28f6fb8c..745b942ef 100644 --- a/examples/src/test/scala/hybrid/wallet/HWalletSpecification.scala +++ b/examples/src/test/scala/hybrid/wallet/HWalletSpecification.scala @@ -4,8 +4,9 @@ import examples.commons.Value import examples.hybrid.blocks.PosBlock import examples.hybrid.wallet.HBoxWallet import hybrid.HybridGenerators -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.bytesToId import scorex.core.transaction.box.proposition.PublicKey25519Proposition import scorex.core.transaction.proof.Signature25519 @@ -16,9 +17,8 @@ import scala.annotation.tailrec import scala.util.Random @SuppressWarnings(Array("org.wartremover.warts.TraversableOps")) -class HWalletSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class HWalletSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with HybridGenerators { diff --git a/examples/src/test/scala/spv/ChainTests.scala b/examples/src/test/scala/spv/ChainTests.scala index b590d5d79..bcb0f4dcc 100644 --- a/examples/src/test/scala/spv/ChainTests.scala +++ b/examples/src/test/scala/spv/ChainTests.scala @@ -3,8 +3,9 @@ package spv import examples.spv.simulation.SimulatorFuctions import examples.spv.{Header, KLS16ProofSerializer, KMZProofSerializer, SpvAlgos} import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.box.proposition.PublicKey25519Proposition import scorex.core.transaction.state.{PrivateKey25519, PrivateKey25519Companion} import scorex.crypto.hash @@ -12,9 +13,8 @@ import scorex.crypto.hash.Blake2b256 import scorex.util.ModifierId @SuppressWarnings(Array("org.wartremover.warts.TraversableOps")) -class ChainTests extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class ChainTests extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with SPVGenerators with SimulatorFuctions { diff --git a/examples/src/test/scala/spv/serialization/SerializationTests.scala b/examples/src/test/scala/spv/serialization/SerializationTests.scala index e17705e7e..9ff5c6576 100644 --- a/examples/src/test/scala/spv/serialization/SerializationTests.scala +++ b/examples/src/test/scala/spv/serialization/SerializationTests.scala @@ -1,13 +1,13 @@ package spv.serialization import examples.spv.{Header, HeaderSerializer} -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import spv.SPVGenerators -class SerializationTests extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SerializationTests extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with SPVGenerators { diff --git a/examples/src/test/scala/trimchain/serialization/SerializationTests.scala b/examples/src/test/scala/trimchain/serialization/SerializationTests.scala index b56bfdd23..67a3f0541 100644 --- a/examples/src/test/scala/trimchain/serialization/SerializationTests.scala +++ b/examples/src/test/scala/trimchain/serialization/SerializationTests.scala @@ -2,13 +2,13 @@ package trimchain.serialization import examples.trimchain.core.{Ticket, TicketSerializer} import examples.trimchain.modifiers.{BlockHeader, BlockHeaderSerializer, TBlock, TBlockSerializer} -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import trimchain.TrimchainGenerators -class SerializationTests extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SerializationTests extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with TrimchainGenerators { diff --git a/src/main/scala/scorex/util/serialization/VLQByteStringReader.scala b/src/main/scala/scorex/util/serialization/VLQByteStringReader.scala index bb75ccb3f..d0c7dd42e 100644 --- a/src/main/scala/scorex/util/serialization/VLQByteStringReader.scala +++ b/src/main/scala/scorex/util/serialization/VLQByteStringReader.scala @@ -34,6 +34,7 @@ class VLQByteStringReader(byteString: ByteString) extends VLQReader { @inline override def getBytes(size: Int): Array[Byte] = { + require(size <= remaining, s"Not enough bytes in the buffer: $size") incPosition(size) it.getBytes(size) } diff --git a/src/main/scala/scorex/util/serialization/VLQByteStringWriter.scala b/src/main/scala/scorex/util/serialization/VLQByteStringWriter.scala index a1943cc96..df25d1dc5 100644 --- a/src/main/scala/scorex/util/serialization/VLQByteStringWriter.scala +++ b/src/main/scala/scorex/util/serialization/VLQByteStringWriter.scala @@ -37,6 +37,13 @@ class VLQByteStringWriter extends VLQWriter { this } + override def putBytes(xs: Array[Byte], + offset: Int, + length: Int): VLQByteStringWriter.this.type = { + builder.putBytes(xs, offset, length) + this + } + @inline override def putBytes(xs: Array[Byte]): this.type = { builder.putBytes(xs) diff --git a/src/test/scala/scorex/core/DefaultModifiersCacheSpecification.scala b/src/test/scala/scorex/core/DefaultModifiersCacheSpecification.scala index 86c8c9401..ba5b7f995 100644 --- a/src/test/scala/scorex/core/DefaultModifiersCacheSpecification.scala +++ b/src/test/scala/scorex/core/DefaultModifiersCacheSpecification.scala @@ -1,17 +1,17 @@ package scorex.core -import org.scalatest.{Matchers, PropSpec} -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import scorex.core.consensus.{History, HistoryReader, ModifierSemanticValidity, SyncInfo} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import scorex.core.consensus.{SyncInfo, History, HistoryReader, ModifierSemanticValidity} import scorex.core.consensus.History.ModifierIds import scorex.core.serialization.ScorexSerializer import scorex.crypto.hash.Blake2b256 import scala.util.Try -class DefaultModifiersCacheSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class DefaultModifiersCacheSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers { private class FakeModifier extends PersistentNodeViewModifier { diff --git a/src/test/scala/scorex/core/api/http/ApiResponseTest.scala b/src/test/scala/scorex/core/api/http/ApiResponseTest.scala index a395e2588..fdff15f81 100644 --- a/src/test/scala/scorex/core/api/http/ApiResponseTest.scala +++ b/src/test/scala/scorex/core/api/http/ApiResponseTest.scala @@ -4,11 +4,12 @@ import akka.http.scaladsl.model.{HttpRequest, StatusCodes} import akka.http.scaladsl.testkit.ScalatestRouteTest import io.circe.Json import io.circe.syntax._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.Future -class ApiResponseTest extends FlatSpec with Matchers with ScalatestRouteTest { +class ApiResponseTest extends AnyFlatSpec with Matchers with ScalatestRouteTest { private val request = HttpRequest() diff --git a/src/test/scala/scorex/core/api/http/PeersApiRouteSpec.scala b/src/test/scala/scorex/core/api/http/PeersApiRouteSpec.scala index d0b3084ca..a970e81ee 100644 --- a/src/test/scala/scorex/core/api/http/PeersApiRouteSpec.scala +++ b/src/test/scala/scorex/core/api/http/PeersApiRouteSpec.scala @@ -2,12 +2,13 @@ package scorex.core.api.http import java.net.InetSocketAddress -import akka.http.scaladsl.model.{ContentTypes, HttpEntity, StatusCodes} -import akka.http.scaladsl.testkit.{RouteTestTimeout, ScalatestRouteTest} +import akka.http.scaladsl.model.{ContentTypes, StatusCodes, HttpEntity} +import akka.http.scaladsl.testkit.{ScalatestRouteTest, RouteTestTimeout} import akka.testkit.TestDuration import io.circe.Json import io.circe.syntax._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scorex.core.api.http.PeersApiRoute.PeerInfoResponse import scorex.core.settings.{RESTApiSettings, ScorexSettings} import scorex.core.utils.NetworkTimeProvider @@ -15,7 +16,7 @@ import scorex.core.utils.NetworkTimeProvider import scala.concurrent.duration._ import scala.language.postfixOps -class PeersApiRouteSpec extends FlatSpec +class PeersApiRouteSpec extends AnyFlatSpec with Matchers with ScalatestRouteTest with Stubs { diff --git a/src/test/scala/scorex/core/api/http/UtilsApiRouteSpec.scala b/src/test/scala/scorex/core/api/http/UtilsApiRouteSpec.scala index 73aec3849..ca117361e 100644 --- a/src/test/scala/scorex/core/api/http/UtilsApiRouteSpec.scala +++ b/src/test/scala/scorex/core/api/http/UtilsApiRouteSpec.scala @@ -2,18 +2,19 @@ package scorex.core.api.http import java.net.InetSocketAddress -import akka.http.scaladsl.model.{ContentTypes, HttpEntity, StatusCodes} +import akka.http.scaladsl.model.{ContentTypes, StatusCodes, HttpEntity} import akka.http.scaladsl.server -import akka.http.scaladsl.testkit.{RouteTestTimeout, ScalatestRouteTest} +import akka.http.scaladsl.testkit.{ScalatestRouteTest, RouteTestTimeout} import akka.testkit.TestDuration import io.circe.syntax._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scorex.core.settings.RESTApiSettings import scala.concurrent.duration._ import scala.language.postfixOps -class UtilsApiRouteSpec extends FlatSpec +class UtilsApiRouteSpec extends AnyFlatSpec with Matchers with ScalatestRouteTest with Stubs { diff --git a/src/test/scala/scorex/core/network/HandshakeSpecification.scala b/src/test/scala/scorex/core/network/HandshakeSpecification.scala index a3fed3d5a..a2c1e45b8 100644 --- a/src/test/scala/scorex/core/network/HandshakeSpecification.scala +++ b/src/test/scala/scorex/core/network/HandshakeSpecification.scala @@ -3,16 +3,16 @@ package scorex.core.network import java.net.InetSocketAddress import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.ObjectGenerators import scorex.core.app.Version import scorex.core.network.message.HandshakeSpec -class HandshakeSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class HandshakeSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with ObjectGenerators { diff --git a/src/test/scala/scorex/core/serialization/SerializerRegistrySpec.scala b/src/test/scala/scorex/core/serialization/SerializerRegistrySpec.scala index 0a5ac6a57..7207d81cd 100644 --- a/src/test/scala/scorex/core/serialization/SerializerRegistrySpec.scala +++ b/src/test/scala/scorex/core/serialization/SerializerRegistrySpec.scala @@ -2,13 +2,14 @@ package scorex.core.serialization import io.circe.Encoder import io.circe.syntax._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scorex.core.serialization.SerializerRegistry.SerializerRecord import scala.reflect.ClassTag import scala.util.{Random, Try} -class SerializerRegistrySpec extends FlatSpec with Matchers { +class SerializerRegistrySpec extends AnyFlatSpec with Matchers { sealed trait Creature sealed case class Human(name: String, country: String) extends Creature diff --git a/src/test/scala/scorex/core/transaction/box/proposition/PublicKey25519PropositionSpecification.scala b/src/test/scala/scorex/core/transaction/box/proposition/PublicKey25519PropositionSpecification.scala index 765e091f5..bbc2e452f 100644 --- a/src/test/scala/scorex/core/transaction/box/proposition/PublicKey25519PropositionSpecification.scala +++ b/src/test/scala/scorex/core/transaction/box/proposition/PublicKey25519PropositionSpecification.scala @@ -1,12 +1,12 @@ package scorex.core.transaction.box.proposition -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.state.PrivateKey25519Companion -class PublicKey25519PropositionSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class PublicKey25519PropositionSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers { property("PublicKey25519Proposition generates valid addresses") { diff --git a/src/test/scala/scorex/core/validation/ValidationSpec.scala b/src/test/scala/scorex/core/validation/ValidationSpec.scala index 8e989a9aa..006432b2a 100644 --- a/src/test/scala/scorex/core/validation/ValidationSpec.scala +++ b/src/test/scala/scorex/core/validation/ValidationSpec.scala @@ -1,6 +1,7 @@ package scorex.core.validation -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scorex.core.bytesToId import scorex.core.consensus.ModifierSemanticValidity import scorex.core.utils.ScorexEncoding @@ -8,7 +9,7 @@ import scorex.core.validation.ValidationResult._ import scala.util.{Failure, Try} -class ValidationSpec extends FlatSpec with Matchers with ScorexEncoding { +class ValidationSpec extends AnyFlatSpec with Matchers with ScorexEncoding { val errMsg1 = "Error message 1: " val errMsg3 = "Error message 3: " diff --git a/src/test/scala/scorex/crypto/SigningFunctionsSpecification.scala b/src/test/scala/scorex/crypto/SigningFunctionsSpecification.scala index f6fc10e81..ebf571ab8 100644 --- a/src/test/scala/scorex/crypto/SigningFunctionsSpecification.scala +++ b/src/test/scala/scorex/crypto/SigningFunctionsSpecification.scala @@ -1,13 +1,13 @@ package scorex.crypto -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} -import scorex.core.transaction.state.{PrivateKey25519Companion, PrivateKey25519Serializer} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import scorex.core.transaction.state.{PrivateKey25519Serializer, PrivateKey25519Companion} -class SigningFunctionsSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class SigningFunctionsSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers { property("PrivateKey25519Companion generates valid keypair") { diff --git a/src/test/scala/scorex/network/DeliveryTrackerSpecification.scala b/src/test/scala/scorex/network/DeliveryTrackerSpecification.scala index f73685297..cdc55d487 100644 --- a/src/test/scala/scorex/network/DeliveryTrackerSpecification.scala +++ b/src/test/scala/scorex/network/DeliveryTrackerSpecification.scala @@ -2,15 +2,16 @@ package scorex.core.network import akka.actor.{ActorRef, ActorSystem} import akka.testkit.TestProbe -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.ObjectGenerators import scorex.core.consensus.ContainsModifiers import scorex.core.network.ModifiersStatus._ import scorex.core.serialization.ScorexSerializer -import scorex.core.{ModifierTypeId, PersistentNodeViewModifier} +import scorex.core.{PersistentNodeViewModifier, ModifierTypeId} import scorex.crypto.hash.Blake2b256 -import scorex.util.{ModifierId, bytesToId} +import scorex.util.{bytesToId, ModifierId} import scala.collection.concurrent.TrieMap import scala.concurrent.ExecutionContext.Implicits.global @@ -20,9 +21,8 @@ import scala.concurrent.duration._ "org.wartremover.warts.Null", "org.wartremover.warts.TraversableOps", "org.wartremover.warts.OptionPartial")) -class DeliveryTrackerSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class DeliveryTrackerSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with ObjectGenerators { diff --git a/src/test/scala/scorex/network/MessageSpecification.scala b/src/test/scala/scorex/network/MessageSpecification.scala index 32afb3428..74d6ca061 100644 --- a/src/test/scala/scorex/network/MessageSpecification.scala +++ b/src/test/scala/scorex/network/MessageSpecification.scala @@ -1,8 +1,9 @@ package scorex.network import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.ObjectGenerators import scorex.core.network.message._ import scorex.core.ModifierTypeId @@ -11,9 +12,8 @@ import scorex.util.ModifierId import scala.util.Try -class MessageSpecification extends PropSpec - with PropertyChecks - with GeneratorDrivenPropertyChecks +class MessageSpecification extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers with ObjectGenerators { diff --git a/src/test/scala/scorex/network/NetworkControllerSpec.scala b/src/test/scala/scorex/network/NetworkControllerSpec.scala index d9f0bb740..d5a48fe00 100644 --- a/src/test/scala/scorex/network/NetworkControllerSpec.scala +++ b/src/test/scala/scorex/network/NetworkControllerSpec.scala @@ -8,15 +8,14 @@ import akka.io.Tcp.{Message => _, _} import akka.testkit.TestProbe import akka.util.ByteString import org.scalatest.EitherValues._ -import org.scalatest.Matchers import org.scalatest.OptionValues._ import org.scalatest.TryValues._ -import scorex.core.api.http.PeersApiRoute.PeersStatusResponse -import scorex.core.app.{ScorexContext, Version} +import org.scalatest.matchers.should.Matchers +import scorex.core.app.{Version, ScorexContext} import scorex.core.network.NetworkController.ReceivableMessages.{GetConnectedPeers, GetPeersStatus} import scorex.core.network._ import scorex.core.network.message.{PeersSpec, _} -import scorex.core.network.peer.{LocalAddressPeerFeature, LocalAddressPeerFeatureSerializer, PeerInfo, PeerManagerRef, PeersStatus} +import scorex.core.network.peer.{LocalAddressPeerFeature, PeerManagerRef, LocalAddressPeerFeatureSerializer, PeersStatus} import scorex.core.settings.ScorexSettings import scorex.core.utils.LocalTimeProvider diff --git a/src/test/scala/scorex/network/NetworkTests.scala b/src/test/scala/scorex/network/NetworkTests.scala index 218c93581..813e7532b 100644 --- a/src/test/scala/scorex/network/NetworkTests.scala +++ b/src/test/scala/scorex/network/NetworkTests.scala @@ -2,7 +2,8 @@ package scorex.network import java.net.InetSocketAddress -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scorex.core.app.Version import scorex.core.network.PeerSpec import scorex.core.network.peer.PeerInfo @@ -10,7 +11,7 @@ import scorex.core.settings.ScorexSettings import scorex.core.utils.{NetworkTimeProvider, TimeProvider} import scala.concurrent.ExecutionContext.Implicits.global -class NetworkTests extends FlatSpec with Matchers { +class NetworkTests extends AnyFlatSpec with Matchers { protected val settings: ScorexSettings = ScorexSettings.read(None) protected val timeProvider: NetworkTimeProvider = new NetworkTimeProvider(settings.ntp) diff --git a/src/test/scala/scorex/network/PeerConnectionHandlerSpecification.scala b/src/test/scala/scorex/network/PeerConnectionHandlerSpecification.scala index 82a188e39..410e91208 100644 --- a/src/test/scala/scorex/network/PeerConnectionHandlerSpecification.scala +++ b/src/test/scala/scorex/network/PeerConnectionHandlerSpecification.scala @@ -1,7 +1,8 @@ package scorex.network -import org.scalatest._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PeerConnectionHandlerSpecification extends FlatSpec with Matchers { +class PeerConnectionHandlerSpecification extends AnyFlatSpec with Matchers { //todo: for Dmitry (?) : write tests for handshaking process } diff --git a/src/test/scala/scorex/util/ScorexLoggingSpec.scala b/src/test/scala/scorex/util/ScorexLoggingSpec.scala index efdf26dbd..42f070a64 100644 --- a/src/test/scala/scorex/util/ScorexLoggingSpec.scala +++ b/src/test/scala/scorex/util/ScorexLoggingSpec.scala @@ -1,8 +1,9 @@ package scorex.util -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ScorexLoggingSpec extends FlatSpec with Matchers with ScorexLogging { +class ScorexLoggingSpec extends AnyFlatSpec with Matchers with ScorexLogging { "Logger" should "evaluate messages only if the respective log level is enabled" in { var i = 0 diff --git a/testkit/build.sbt b/testkit/build.sbt index e7f3e9ff4..18bad0e7b 100644 --- a/testkit/build.sbt +++ b/testkit/build.sbt @@ -2,8 +2,9 @@ name := "scorex-testkit" libraryDependencies ++= Seq( "org.scalactic" %% "scalactic" % "3.0.1", - "org.scalatest" %% "scalatest" % "3.0.1", - "org.scalacheck" %% "scalacheck" % "1.13.+", + "org.scalatest" %% "scalatest" % "3.1.1", + "org.scalacheck" %% "scalacheck" % "1.14.+", + "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2", "com.typesafe.akka" %% "akka-testkit" % "2.4.+" ) diff --git a/testkit/src/main/scala/scorex/testkit/SerializationTests.scala b/testkit/src/main/scala/scorex/testkit/SerializationTests.scala index db542a6a9..23034ada8 100644 --- a/testkit/src/main/scala/scorex/testkit/SerializationTests.scala +++ b/testkit/src/main/scala/scorex/testkit/SerializationTests.scala @@ -1,11 +1,12 @@ package scorex.testkit import org.scalacheck.Gen -import org.scalatest.{Assertion, Matchers} -import org.scalatest.prop.GeneratorDrivenPropertyChecks +import org.scalatest.Assertion +import org.scalatest.matchers.should.Matchers +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.serialization.ScorexSerializer -trait SerializationTests extends GeneratorDrivenPropertyChecks with Matchers { +trait SerializationTests extends ScalaCheckPropertyChecks with Matchers { def checkSerializationRoundtrip[A](generator: Gen[A], serializer: ScorexSerializer[A]): Assertion = { forAll(generator) { b: A => val recovered = serializer.parseBytes(serializer.toBytes(b)) diff --git a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala index e8aee6a30..bfa1ac829 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala @@ -1,23 +1,22 @@ package scorex.testkit.properties import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.PersistentNodeViewModifier import scorex.core.consensus.{History, SyncInfo} import scorex.core.consensus.ModifierSemanticValidity.Valid import scorex.core.transaction.Transaction -import scorex.core.transaction.box.proposition.Proposition import scorex.testkit.TestkitHelpers import scorex.testkit.generators.SyntacticallyTargetedModifierProducer import scorex.util.ScorexLogging trait HistoryTests[TX <: Transaction, PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM, SI, HT]] - extends PropSpec - with GeneratorDrivenPropertyChecks + extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers - with PropertyChecks with ScorexLogging with TestkitHelpers with SyntacticallyTargetedModifierProducer[PM, SI, HT] { diff --git a/testkit/src/main/scala/scorex/testkit/properties/NodeViewHolderTests.scala b/testkit/src/main/scala/scorex/testkit/properties/NodeViewHolderTests.scala index b9f3e3da1..783c78c1a 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/NodeViewHolderTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/NodeViewHolderTests.scala @@ -2,8 +2,8 @@ package scorex.testkit.properties import akka.actor._ import akka.testkit.TestProbe -import org.scalatest.prop.PropertyChecks -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec import scorex.ObjectGenerators import scorex.core.NodeViewHolder.CurrentView import scorex.core.NodeViewHolder.ReceivableMessages.{GetDataFromCurrentView, LocallyGeneratedModifier, ModifiersFromRemote} @@ -28,9 +28,8 @@ ST <: MinimalState[PM, ST], SI <: SyncInfo, HT <: History[PM, SI, HT], MPool <: MemoryPool[TX, MPool]] - extends PropSpec + extends AnyPropSpec with Matchers - with PropertyChecks with ScorexLogging with SyntacticallyTargetedModifierProducer[PM, SI, HT] with TotallyValidModifierProducer[PM, ST, SI, HT] diff --git a/testkit/src/main/scala/scorex/testkit/properties/NodeViewSynchronizerTests.scala b/testkit/src/main/scala/scorex/testkit/properties/NodeViewSynchronizerTests.scala index a9712abbb..c95851a39 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/NodeViewSynchronizerTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/NodeViewSynchronizerTests.scala @@ -3,8 +3,8 @@ package scorex.testkit.properties import akka.actor._ import akka.testkit.TestProbe import org.scalacheck.Gen -import org.scalatest.prop.PropertyChecks -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec import scorex.core.NodeViewHolder.ReceivableMessages.{GetNodeViewChanges, ModifiersFromRemote} import scorex.core.PersistentNodeViewModifier import scorex.core.consensus.History.{Equal, Nonsense, Older, Younger} @@ -35,9 +35,8 @@ trait NodeViewSynchronizerTests[TX <: Transaction, SI <: SyncInfo, HT <: History[PM, SI, HT], MP <: MemoryPool[TX, MP] -] extends PropSpec +] extends AnyPropSpec with Matchers - with PropertyChecks with ScorexLogging with SyntacticallyTargetedModifierProducer[PM, SI, HT] with TotallyValidModifierProducer[PM, ST, SI, HT] { diff --git a/testkit/src/main/scala/scorex/testkit/properties/WalletSecretsTest.scala b/testkit/src/main/scala/scorex/testkit/properties/WalletSecretsTest.scala index b4beb24b1..3dd78a5d5 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/WalletSecretsTest.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/WalletSecretsTest.scala @@ -1,17 +1,17 @@ package scorex.testkit.properties -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.PersistentNodeViewModifier import scorex.core.transaction.Transaction import scorex.core.transaction.box.proposition.Proposition import scorex.core.transaction.wallet.BoxWallet trait WalletSecretsTest[P <: Proposition, TX <: Transaction, PM <: PersistentNodeViewModifier] - extends PropSpec - with GeneratorDrivenPropertyChecks - with Matchers - with PropertyChecks { + extends AnyPropSpec + with ScalaCheckPropertyChecks + with Matchers { val wallet: BoxWallet[P, TX, PM, _] diff --git a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolFilterPerformanceTest.scala b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolFilterPerformanceTest.scala index 0d20b1779..e95fb8f1a 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolFilterPerformanceTest.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolFilterPerformanceTest.scala @@ -1,17 +1,17 @@ package scorex.testkit.properties.mempool import java.security.MessageDigest -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} -import scorex.core.transaction.box.proposition.Proposition + +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.{MemoryPool, Transaction} import scorex.core.utils._ trait MempoolFilterPerformanceTest[TX <: Transaction, MPool <: MemoryPool[TX, MPool]] - extends PropSpec - with GeneratorDrivenPropertyChecks + extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers - with PropertyChecks with MemoryPoolTest[TX, MPool] { var initializedMempool: Option[MPool] = None diff --git a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolRemovalTest.scala b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolRemovalTest.scala index 87300c829..c20cbd27a 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolRemovalTest.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolRemovalTest.scala @@ -1,8 +1,9 @@ package scorex.testkit.properties.mempool import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.{PersistentNodeViewModifier, TransactionsCarryingPersistentNodeViewModifier} import scorex.core.consensus.{History, SyncInfo} import scorex.core.transaction.{MemoryPool, Transaction} @@ -16,10 +17,9 @@ MPool <: MemoryPool[TX, MPool], PM <: PersistentNodeViewModifier, CTM <: PM with TransactionsCarryingPersistentNodeViewModifier[TX], HT <: History[PM, SI, HT], -SI <: SyncInfo] extends PropSpec - with GeneratorDrivenPropertyChecks +SI <: SyncInfo] extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers - with PropertyChecks with ScorexLogging with TestkitHelpers with MemoryPoolTest[TX, MPool] diff --git a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolTransactionsTest.scala b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolTransactionsTest.scala index 0c47156f6..ff8f5abde 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolTransactionsTest.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/mempool/MempoolTransactionsTest.scala @@ -1,16 +1,16 @@ package scorex.testkit.properties.mempool import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.transaction.{MemoryPool, Transaction} @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) trait MempoolTransactionsTest[TX <: Transaction, MPool <: MemoryPool[TX, MPool]] - extends PropSpec - with GeneratorDrivenPropertyChecks + extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers - with PropertyChecks with MemoryPoolTest[TX, MPool] { val transactionSeqGenerator: Gen[Seq[TX]] = Gen.nonEmptyContainerOf[Seq, TX](transactionGenerator) diff --git a/testkit/src/main/scala/scorex/testkit/properties/state/StateTests.scala b/testkit/src/main/scala/scorex/testkit/properties/state/StateTests.scala index 61cbce2ad..dd61b3b53 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/state/StateTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/state/StateTests.scala @@ -1,18 +1,18 @@ package scorex.testkit.properties.state import org.scalacheck.Gen -import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks} -import org.scalatest.{Matchers, PropSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scorex.core.PersistentNodeViewModifier import scorex.core.transaction.state.MinimalState import scorex.testkit.TestkitHelpers -import scorex.testkit.generators.{CoreGenerators, SemanticallyInvalidModifierProducer, SemanticallyValidModifierProducer} +import scorex.testkit.generators.{SemanticallyValidModifierProducer, SemanticallyInvalidModifierProducer, CoreGenerators} trait StateTests[PM <: PersistentNodeViewModifier, ST <: MinimalState[PM, ST]] - extends PropSpec - with GeneratorDrivenPropertyChecks + extends AnyPropSpec + with ScalaCheckPropertyChecks with Matchers - with PropertyChecks with CoreGenerators with TestkitHelpers with SemanticallyValidModifierProducer[PM, ST]