From 7d7fd4eea0ec191848f76ef012ed7e0f3bdefe67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Kope=C4=87?= Date: Fri, 25 Sep 2020 13:56:18 +0200 Subject: [PATCH] [Chore] update scalatest (#689) * [Chore] Update ScalaTest * [Chore] Update Scalamock * [Chore] Update repo.nix --- project/Dependencies.scala | 5 +- repo.nix | 648 ++++++++++++++---- .../mpt/MerklePatriciaTreeSpeedSpec.scala | 4 +- .../io/iohk/ethereum/rlp/RLPSpeedSuite.scala | 4 +- .../ets/blockchain/BlockchainSuite.scala | 18 +- .../io/iohk/ethereum/ets/vm/VMSuite.scala | 10 +- .../ethereum/vm/CallSelfDestructSpec.scala | 5 +- .../io/iohk/ethereum/vm/CallerSpec.scala | 5 +- .../vm/ContractCallingItselfSpec.scala | 5 +- .../io/iohk/ethereum/vm/FibonacciSpec.scala | 5 +- .../ethereum/vm/MinimumViableTokenSpec.scala | 9 +- .../ethereum/vm/MutualRecursionSpec.scala | 5 +- .../vm/PrecompiledContractsSpecEvm.scala | 5 +- .../scala/io/iohk/ethereum/vm/ThrowSpec.scala | 5 +- .../DataSourceIntegrationTestBehavior.scala | 35 +- .../RocksDbDataSourceIntegrationSuite.scala | 30 +- .../MerklePatriciaTreeIntegrationSuite.scala | 6 +- .../iohk/ethereum/sync/FastSyncItSpec.scala | 165 +++-- .../ethereum/txExecTest/ContractTest.scala | 5 +- .../ethereum/txExecTest/ECIP1017Test.scala | 16 +- .../iohk/ethereum/txExecTest/ForksTest.scala | 14 +- .../iohk/ethereum/rpcTest/RpcApiTests.scala | 398 +++++++---- .../io/iohk/ethereum/snappy/SnappyTest.scala | 21 +- .../iohk/ethereum/BootstrapDownloadSpec.scala | 5 +- .../scala/io/iohk/ethereum/SpecBase.scala | 7 +- .../blockchain/sync/BlockBroadcastSpec.scala | 5 +- .../sync/BlockchainHostActorSpec.scala | 5 +- .../sync/FastSyncStateStorageActorSpec.scala | 3 +- .../blockchain/sync/SyncControllerSpec.scala | 6 +- .../blockchain/sync/SyncStateSpec.scala | 5 +- .../sync/regular/BlockFetcherStateSpec.scala | 5 +- .../sync/regular/OldRegularSyncSpec.scala | 5 +- .../sync/regular/RegularSyncFixtures.scala | 2 +- .../sync/regular/RegularSyncSpec.scala | 6 +- .../consensus/BlockGeneratorSpec.scala | 5 +- .../ethereum/consensus/ConsensusSpec.scala | 5 +- .../consensus/ethash/EthashMinerSpec.scala | 6 +- .../consensus/ethash/EthashUtilsSpec.scala | 5 +- .../consensus/ethash/MockedMinerSpec.scala | 4 +- .../validators/BlockHeaderValidatorSpec.scala | 5 +- .../validators/BlockValidatorSpec.scala | 5 +- .../validators/OmmersValidatorSpec.scala | 5 +- .../SignedTransactionValidatorSpec.scala | 5 +- .../io/iohk/ethereum/crypto/AesCbcSpec.scala | 5 +- .../io/iohk/ethereum/crypto/AesCtrSpec.scala | 5 +- .../ethereum/crypto/ECDSASignatureSpec.scala | 5 +- .../iohk/ethereum/crypto/ECIESCoderSpec.scala | 5 +- .../crypto/Pbkdf2HMacSha256Spec.scala | 5 +- .../iohk/ethereum/crypto/Ripemd160Spec.scala | 5 +- .../io/iohk/ethereum/crypto/ScryptSpec.scala | 5 +- .../crypto/zksnarks/BN128FpSpec.scala | 4 +- .../crypto/zksnarks/FpFieldSpec.scala | 4 +- .../dataSource/DataSourceTestBehavior.scala | 12 +- .../db/dataSource/EphemDataSourceSuite.scala | 4 +- .../db/dataSource/RocksDbDataSourceTest.scala | 4 +- .../db/storage/AppStateStorageSpec.scala | 7 +- .../db/storage/BlockBodiesStorageSpec.scala | 4 +- .../db/storage/BlockHeadersStorageSpec.scala | 4 +- .../db/storage/CachedNodeStorageSpec.scala | 5 +- .../CachedReferenceCountedStorageSpec.scala | 5 +- .../db/storage/CodeStorageSuite.scala | 4 +- .../db/storage/KeyValueStorageSuite.scala | 4 +- .../db/storage/NodeStorageSuite.scala | 4 +- .../db/storage/ReadOnlyNodeStorageSpec.scala | 5 +- .../db/storage/ReceiptStorageSuite.scala | 4 +- .../ReferenceCountNodeStorageSpec.scala | 5 +- .../db/storage/StateStorageSpec.scala | 5 +- .../storage/TotalDifficultyStorageSuite.scala | 4 +- .../TransactionMappingStorageSuite.scala | 4 +- .../TransactionalKeyValueStorageSuite.scala | 4 +- .../domain/ArbitraryIntegerMptSpec.scala | 5 +- .../ethereum/domain/BlockHeaderSpec.scala | 11 +- .../io/iohk/ethereum/domain/BlockSpec.scala | 5 +- .../iohk/ethereum/domain/BlockchainSpec.scala | 5 +- .../domain/SignedTransactionSpec.scala | 5 +- .../io/iohk/ethereum/domain/UInt256Spec.scala | 4 +- .../ethereum/extvm/MessageHandlerSpec.scala | 5 +- .../io/iohk/ethereum/extvm/VMClientSpec.scala | 5 +- .../io/iohk/ethereum/extvm/VMServerSpec.scala | 5 +- .../io/iohk/ethereum/extvm/WorldSpec.scala | 5 +- .../iohk/ethereum/faucet/FaucetApiSpec.scala | 5 +- .../ethereum/jsonrpc/DebugServiceSpec.scala | 5 +- .../ethereum/jsonrpc/EthServiceSpec.scala | 5 +- .../ethereum/jsonrpc/ExpiringMapSpec.scala | 5 +- .../ethereum/jsonrpc/FilterManagerSpec.scala | 5 +- .../iohk/ethereum/jsonrpc/JRCMatchers.scala | 2 +- .../jsonrpc/JsonRpcControllerSpec.scala | 5 +- .../ethereum/jsonrpc/NetServiceSpec.scala | 5 +- .../jsonrpc/PersonalServiceSpec.scala | 17 +- .../io/iohk/ethereum/jsonrpc/QaJRCSpec.scala | 5 +- .../server/http/JsonRpcHttpServerSpec.scala | 5 +- .../ethereum/keystore/EncryptedKeySpec.scala | 5 +- .../ethereum/keystore/KeyStoreImplSpec.scala | 6 +- .../ethereum/ledger/BlockExecutionSpec.scala | 5 +- .../ethereum/ledger/BlockImportSpec.scala | 5 +- .../ethereum/ledger/BlockPreparatorSpec.scala | 5 +- .../iohk/ethereum/ledger/BlockQueueSpec.scala | 5 +- .../ledger/BlockRewardCalculatorSpec.scala | 5 +- .../ethereum/ledger/BlockRewardSpec.scala | 5 +- .../ethereum/ledger/BlockValidationSpec.scala | 5 +- .../ethereum/ledger/BloomFilterSpec.scala | 5 +- .../ledger/BranchResolutionSpec.scala | 5 +- .../ethereum/ledger/DeleteAccountsSpec.scala | 5 +- .../ledger/DeleteTouchedAccountsSpec.scala | 5 +- .../ledger/InMemorySimpleMapProxySpec.scala | 5 +- .../ledger/InMemoryWorldStateProxySpec.scala | 5 +- .../io/iohk/ethereum/ledger/LedgerSpec.scala | 5 +- .../iohk/ethereum/ledger/StxLedgerSpec.scala | 31 +- .../io/iohk/ethereum/mpt/HexPrefixSuite.scala | 4 +- .../mpt/MerklePatriciaTrieSuite.scala | 4 +- .../AsymmetricCipherKeyPairLoaderSpec.scala | 5 +- .../ethereum/network/AuthHandshakerSpec.scala | 5 +- .../network/AuthInitiateMessageSpec.scala | 5 +- .../ethereum/network/EtcPeerManagerSpec.scala | 5 +- .../network/KnownNodesManagerSpec.scala | 5 +- .../ethereum/network/NodeParserSpec.scala | 5 +- .../network/PeerActorHandshakingSpec.scala | 5 +- .../network/PeerEventBusActorSpec.scala | 5 +- .../ethereum/network/PeerManagerSpec.scala | 5 +- .../discovery/PeerDiscoveryManagerSpec.scala | 5 +- .../handshaker/EtcHandshakerSpec.scala | 5 +- .../ethereum/network/p2p/FrameCodecSpec.scala | 5 +- .../network/p2p/MessageCodecSpec.scala | 5 +- .../ethereum/network/p2p/MessageSpec.scala | 5 +- .../ethereum/network/p2p/PeerActorSpec.scala | 5 +- .../messages/MessagesSerializationSpec.scala | 5 +- .../network/p2p/messages/NewBlockSpec.scala | 4 +- .../network/p2p/messages/NodeDataSpec.scala | 5 +- .../network/p2p/messages/ReceiptsSpec.scala | 5 +- .../p2p/messages/TransactionSpec.scala | 5 +- .../network/rlpx/MessageCompressionSpec.scala | 5 +- .../rlpx/RLPxConnectionHandlerSpec.scala | 5 +- .../iohk/ethereum/ommers/OmmersPoolSpec.scala | 5 +- .../scala/io/iohk/ethereum/rlp/RLPSuite.scala | 4 +- .../PendingTransactionsManagerSpec.scala | 5 +- .../iohk/ethereum/utils/ByteUtilsSpec.scala | 4 +- .../iohk/ethereum/utils/ConfigUtilsSpec.scala | 5 +- .../ethereum/vm/BlakeCompressionSpec.scala | 5 +- .../io/iohk/ethereum/vm/CallOpcodesSpec.scala | 5 +- .../vm/CallOpcodesSpecPostEip161.scala | 5 +- .../iohk/ethereum/vm/CreateOpcodeSpec.scala | 5 +- .../io/iohk/ethereum/vm/MemorySpec.scala | 5 +- .../io/iohk/ethereum/vm/OpCodeFunSpec.scala | 5 +- .../io/iohk/ethereum/vm/OpCodeGasSpec.scala | 5 +- .../ethereum/vm/OpCodeGasSpecPostEip161.scala | 5 +- .../io/iohk/ethereum/vm/OpCodeTesting.scala | 10 +- .../vm/PrecompiledContractsSpec.scala | 5 +- .../io/iohk/ethereum/vm/ProgramSpec.scala | 5 +- ...STOREOpCodeGasPostConstantinopleSpec.scala | 5 +- .../iohk/ethereum/vm/ShiftingOpCodeSpec.scala | 5 +- .../scala/io/iohk/ethereum/vm/StackSpec.scala | 5 +- .../ethereum/vm/StaticCallOpcodeSpec.scala | 5 +- .../scala/io/iohk/ethereum/vm/VMSpec.scala | 5 +- 153 files changed, 1409 insertions(+), 700 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 9767d957ab..298fcc12d9 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -51,8 +51,9 @@ object Dependencies { ) val testing: Seq[ModuleID] = Seq( - "org.scalatest" %% "scalatest" % "3.0.8" % "it,test", - "org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % "test", + "org.scalatest" %% "scalatest" % "3.2.2" % "it,test", + "org.scalamock" %% "scalamock" % "5.0.0" % "test", + "org.scalatestplus" %% "scalacheck-1-14" % "3.2.2.0" % "test", "org.scalacheck" %% "scalacheck" % "1.14.1" % "it,test" ) diff --git a/repo.nix b/repo.nix index 719f6630a9..1248c92031 100644 --- a/repo.nix +++ b/repo.nix @@ -588,6 +588,26 @@ url = "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.pom"; sha256 = "5FACA824BA115BEE458730337DFDB2FCEA46BA2FD774D4304EDBF30FA6A3F055"; }; + "nix-public/com/google/protobuf/protobuf-bom/3.11.4/protobuf-bom-3.11.4.pom" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.11.4/protobuf-bom-3.11.4.pom"; + sha256 = "74EE43B09E711B13D568811E12F33BD16E6087B15F1AEDED22B0DFE89AE76856"; + }; + "nix-public/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-javadoc.jar"; + sha256 = "7481F003B1D1F79361DFF44E8E70D8337CD0E3798BCAAE36A11C9032F98A2846"; + }; + "nix-public/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-sources.jar"; + sha256 = "BC220C90651F509FBA201F857715FBC4BD3A15580506AB96413F2BC1728EC4A8"; + }; + "nix-public/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.jar" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.jar"; + sha256 = "42E98F58F53D1A49FD734C2DD193880F2DFEC3436A2993A00D06B8800A22A3F2"; + }; + "nix-public/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.pom" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.pom"; + sha256 = "7FF9A378EA309A73E0BF1F0D84F7751BFE21CF3A038E4E78F923C31B0EBA0246"; + }; "nix-public/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0-javadoc.jar" = { url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0-javadoc.jar"; sha256 = "AD810CD0D6786E656C8BF3C0EA9851BCD3FBA2CCBC1E803326B4012BE0943D19"; @@ -604,6 +624,10 @@ url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.pom"; sha256 = "83F17BA86C5FA1A15A3A3C8030D4CE42EF21C1D39B65DB6CC004A8EEB2C59406"; }; + "nix-public/com/google/protobuf/protobuf-parent/3.11.4/protobuf-parent-3.11.4.pom" = { + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-parent/3.11.4/protobuf-parent-3.11.4.pom"; + sha256 = "C3E2AEE04DD8698F8B21CE635C318F8964D52FC9CA490A01A64CDC7A6C44D362"; + }; "nix-public/com/google/protobuf/protobuf-parent/3.4.0/protobuf-parent-3.4.0.pom" = { url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-parent/3.4.0/protobuf-parent-3.4.0.pom"; sha256 = "24909C552842C0EB7A4C769D631A43CBEF5A9A10C1640F2BDBD1EA149C573A47"; @@ -640,6 +664,38 @@ url = "https://repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/0.4.4/fastparse_2.12-0.4.4.pom"; sha256 = "A0193B3A723EDD65A093D4F1127E033A3873C71821E0F59A1596812DE06A2B4C"; }; + "nix-public/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0-javadoc.jar"; + sha256 = "C02A0DC34E7586CA8E5B151AC9BE0B49D33EA948B3AA44AA501CEF8C07BDF8C2"; + }; + "nix-public/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0-sources.jar"; + sha256 = "21032DBB9B423F336EA5C417C860F30167D06B24166E1E4C080E7E00F57BB614"; + }; + "nix-public/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0.jar"; + sha256 = "780C95D0B477FB3ADC6F38F43321EA569167BFF4EF56481E0C7C423F156369B4"; + }; + "nix-public/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0.pom" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/fastparse_2.12/2.3.0/fastparse_2.12-2.3.0.pom"; + sha256 = "F75AA3429EB57C4C67AC87E3826F682555AB178786CFDDB40306561828B3DCF3"; + }; + "nix-public/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0-javadoc.jar"; + sha256 = "C4551317D7699269BD9821E526D71ACB509CFB98784F7DBB751B7BC1AA320546"; + }; + "nix-public/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0-sources.jar"; + sha256 = "D056D55F288E975E96A47999DA0ACE9F8FC40CF1139098F19A2FF13E07F4B01C"; + }; + "nix-public/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0.jar"; + sha256 = "CC4D4AD6D5239919247AAF4C189F44A571C1F6ECFFDD063623EC16917449A80E"; + }; + "nix-public/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0.pom" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.12/0.6.0/geny_2.12-0.6.0.pom"; + sha256 = "CAA31678A110C36B5CAE60659E3CB30287DC45460DD553B055F3E4A5ABB8D819"; + }; "nix-public/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4-javadoc.jar" = { url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4-javadoc.jar"; sha256 = "D64627A8427BAE6C617F3BE51E3B6B9D61934F0852F39C4C0746C3E01E85EE75"; @@ -656,6 +712,38 @@ url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.pom"; sha256 = "6064AA8E99C4B69EE368573E1527ABB8A9D6D6004CA10C4ACF8CC6EC574AE0CB"; }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6-javadoc.jar"; + sha256 = "E074EB75F95DFD1BE7FF9158C90D1FBF2C6CC9DD4E618D12C91BDC4F0340FF0C"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6-sources.jar"; + sha256 = "EC96257A8404550F6A9263D117C00DDE9C0D48BF0E810B86FDE9BD8212BD94ED"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6.jar"; + sha256 = "3F1270DB76B1C48B9BB56B675630CA1DEF3D67C55BFA2CEBB09D6DC47760EC14"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6.pom" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.6/sourcecode_2.12-0.1.6.pom"; + sha256 = "683BE8D25648D531AD3E54CC60F82060A6D55616CA19359CE803BF37B04DDC58"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1-javadoc.jar"; + sha256 = "13654A92FA10418B578E09A2D7F731A9E3A482BE4370BD87DABFAE95E3E3510C"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1-sources.jar"; + sha256 = "0C2B34B5AAC20B0FDFAA2FDD08CA2D03BDC606E74263EFF0A05D753AE8A7A727"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1.jar" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1.jar"; + sha256 = "A2CF70D2F0FA980BCDA122CD51F1EFDFB9AF57D4C7D982D7F9F4FBE6A84B0A11"; + }; + "nix-public/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1.pom" = { + url = "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.2.1/sourcecode_2.12-0.2.1.pom"; + sha256 = "E0C968E8CCE46BE134398A26AE80D51840B9006A0D4F356F7CEDF7D27BF2213F"; + }; "nix-public/com/miguno/akka/akka-mock-scheduler_2.12/0.5.5/akka-mock-scheduler_2.12-0.5.5-javadoc.jar" = { url = "https://repo1.maven.org/maven2/com/miguno/akka/akka-mock-scheduler_2.12/0.5.5/akka-mock-scheduler_2.12-0.5.5-javadoc.jar"; sha256 = "AB435E4483B667F1768483421DAD03AF845A47A95CC39EA234327EE6E1225470"; @@ -728,6 +816,38 @@ url = "https://repo1.maven.org/maven2/com/squareup/okio/okio/1.13.0/okio-1.13.0.pom"; sha256 = "DDA2F84BCD3E051C7AFD83054CE8F0166DD47E1DE1797C08A6BFF728F41AAA2B"; }; + "nix-public/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3-javadoc.jar"; + sha256 = "37AB7287B6FAAE973CC48265D137B423B6909AB77AC998378EC6926BA439FC2D"; + }; + "nix-public/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3-sources.jar"; + sha256 = "05E73E0ECD15C5193D78E9731724EB63854BAEDB09DB1B0B7DFB223B819B3272"; + }; + "nix-public/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3.jar"; + sha256 = "C160A273D6F30A6559EC7B29583E3097ECCEFBBFCBED20C74B58AAB173F8DA06"; + }; + "nix-public/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3.pom" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.10.3/lenses_2.12-0.10.3.pom"; + sha256 = "1F2023D9CE24B370659CEF8851375CF380BBC724F90A3099E21943488B075BD2"; + }; + "nix-public/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3-javadoc.jar"; + sha256 = "18F7964B9E7439FC200239BDDFA87A8D9125D882A38A3B120839A49F3D756421"; + }; + "nix-public/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3-sources.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3-sources.jar"; + sha256 = "250BC2E6E724F0550903AB23596A9B1246A1A15FA333343BEE6074487ABAD930"; + }; + "nix-public/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3.jar" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3.jar"; + sha256 = "16900D78DE2006F66288405943E9E3680C646A84370DF3510CA36C06A029463F"; + }; + "nix-public/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3.pom" = { + url = "https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.10.3/scalapb-runtime_2.12-0.10.3.pom"; + sha256 = "AAAB63AEF28F99FABD4D1079164CE8CF3EB0DF0207A1D227505CAF74BAC2418B"; + }; "nix-public/com/thoughtworks/paranamer/paranamer-parent/2.8/paranamer-parent-2.8.pom" = { url = "https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer-parent/2.8/paranamer-parent-2.8.pom"; sha256 = "F094F01C1B5BD2A28D27063291A6DC20EA99D8209C037C990264396BCC08F7CD"; @@ -2004,6 +2124,22 @@ url = "https://repo1.maven.org/maven2/org/rocksdb/rocksdbjni/6.11.4/rocksdbjni-6.11.4.pom"; sha256 = "B3A6AA2AA590DD5DD1FB9160DE220756C87BB9BA71815CE3ED39592F8A5338F6"; }; + "nix-public/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6-javadoc.jar"; + sha256 = "C56529CC666EDC0C30E569378C6F2D346A5DD7F292D0ACD83C513B1BB31097B7"; + }; + "nix-public/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6-sources.jar"; + sha256 = "C89EA5D35F67CE2EC5699BC1AA4CCBEAC6ED4C7E441C5CAF245A29DEB162CB4C"; + }; + "nix-public/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6.jar"; + sha256 = "0ABAD435516D3AB62EFF012FC1169E7A4DF3614F36AC130B61C1BAE4283C3548"; + }; + "nix-public/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6.pom" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.12/2.1.6/scala-collection-compat_2.12-2.1.6.pom"; + sha256 = "4824379922D287F6DC1C4F81F604A4E6503B4336020795D76F85C55860CBBF24"; + }; "nix-public/org/scala-lang/modules/scala-java8-compat_2.12/0.8.0/scala-java8-compat_2.12-0.8.0-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-java8-compat_2.12/0.8.0/scala-java8-compat_2.12-0.8.0-javadoc.jar"; sha256 = "9175A09E404F75EC013219B54A51DF8788F890E0443BAE7A96FFC1AE74EF24F2"; @@ -2068,22 +2204,6 @@ url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.12/1.1.2/scala-parser-combinators_2.12-1.1.2.pom"; sha256 = "A5500678F39B9B8C962A8FEE98359E9E2F2A4E5D434F3501762B30188642A2F5"; }; - "nix-public/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5-javadoc.jar"; - sha256 = "C7C6FC332FC92B009C9A069C76CC189411ADA6556786C6EBFDE5D5C19E8B62A3"; - }; - "nix-public/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5-sources.jar"; - sha256 = "B852D7D7C4321FE745DB9189A0C9E905099871129352CD0DA7CC78AC02B06318"; - }; - "nix-public/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5.jar"; - sha256 = "035015366F54F403D076D95F4529CE9EEAF544064DBC17C2D10E4F5908EF4256"; - }; - "nix-public/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5.pom" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5.pom"; - sha256 = "6509A7D180DB8AC5D33569FDB2AC79909B52CBFC4FE823E0629BDE0B51369BFE"; - }; "nix-public/org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6-javadoc.jar"; sha256 = "FF42809FBF887885C957B3D368A909C6CCDDEA4C0485E4FE3A6465ED7747B636"; @@ -2148,22 +2268,6 @@ url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.0/scala-library-2.12.0.pom"; sha256 = "093CA3B7FD4C3D48222F30DA4526808E3E8EF2D4456D1E75793F105D437A24EA"; }; - "nix-public/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1-javadoc.jar"; - sha256 = "7F6BF6122E13E034507118BAB9D61C3BD41637E24C2120D41690C2D8F542FACA"; - }; - "nix-public/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1-sources.jar"; - sha256 = "4F73F24D18108DF3641A6333A1F2BE4F43FCCA982A3A769A5F6C8F99558293CD"; - }; - "nix-public/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.jar"; - sha256 = "9DAB78F3F205A038F48183B2391F8A593235F794D8129A479E06AF3E6BC50EF8"; - }; - "nix-public/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom"; - sha256 = "E2C373E1C000D8431BD625729DB33DCE68B379D3537769D29E18514CB2B3050C"; - }; "nix-public/org/scala-lang/scala-library/2.12.10/scala-library-2.12.10-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.10/scala-library-2.12.10-javadoc.jar"; sha256 = "8782B9DEAE7CC1FD99D9091A8BBE59901B6774670B0C44D084924C680BCB4F1A"; @@ -2292,38 +2396,6 @@ url = "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.9/scala-library-2.12.9.pom"; sha256 = "944763D74692BD794001939936C1A2FAC2BCED9F2C3B0F5A1FFA357ADAF6E146"; }; - "nix-public/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0-javadoc.jar"; - sha256 = "F0EF50559FBAEB6B1BB9C71A4D10659D7B54A661A06CD8D655906B70393FF5B7"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0-sources.jar"; - sha256 = "C21130C1EC42B207DA452BAE3E64B6D237837A2C5954ED29203053690DA100A8"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0.jar"; - sha256 = "F56553934378E6D3E8BF1D759A51F8B2FC4C99370774F0AAEDAAB8619517CCBE"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0.pom" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.0/scala-reflect-2.12.0.pom"; - sha256 = "DC4269D38FFB1AAD787CEF2E695964685C600FE57E8BF91C2AD2D04BF842AC72"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1-javadoc.jar"; - sha256 = "A4644B9F06986C8619CEE3216D7383D974F5C1100364C7776357F3533DC4A4E9"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1-sources.jar"; - sha256 = "DF915BF043F037C8FF5A6F0A88DD8CFC3A927212AE93A61D18049F0A54477E06"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1.jar" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1.jar"; - sha256 = "D8A2B9D6D78C7457A40E394DC0C4FA6D6244ACF0D156BBBCB311A9D497B85EEC"; - }; - "nix-public/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1.pom" = { - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1.pom"; - sha256 = "808B17C95D7E260A375615992CD1FCE7D759B6FDEF5E64D7B70E3942AE014261"; - }; "nix-public/org/scala-lang/scala-reflect/2.12.11/scala-reflect-2.12.11-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.11/scala-reflect-2.12.11-javadoc.jar"; sha256 = "A8E418EA1952DABBD5254B603D5AFBED483D1008F257052F1F365D1B4BE6D7D9"; @@ -2388,6 +2460,22 @@ url = "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.8/scala-reflect-2.12.8.pom"; sha256 = "CBFFFF8D495FFD66C1234469A2965F54A82FA58E6816EE0E5803E896CAC167C3"; }; + "nix-public/org/scala-lang/scalap/2.12.12/scalap-2.12.12-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.12.12/scalap-2.12.12-javadoc.jar"; + sha256 = "6CF12A4977BA6DEAFF80F11FC303F916CC7878A1E1F4236179ABF29243CD6A88"; + }; + "nix-public/org/scala-lang/scalap/2.12.12/scalap-2.12.12-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.12.12/scalap-2.12.12-sources.jar"; + sha256 = "CE68C4966EFF9735379711A32C0354DC52F2DDDB46CA2C04420029D29E21A4EA"; + }; + "nix-public/org/scala-lang/scalap/2.12.12/scalap-2.12.12.jar" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.12.12/scalap-2.12.12.jar"; + sha256 = "777721C8839689BA833E059F112FAA674EBDD5360E08BA2A07533E3E240FFFFC"; + }; + "nix-public/org/scala-lang/scalap/2.12.12/scalap-2.12.12.pom" = { + url = "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.12.12/scalap-2.12.12.pom"; + sha256 = "D3AF670C77637DCE6140C474E50CF4239F7E748EB3B73093D2CFAE000C72F221"; + }; "nix-public/org/scala-sbt/compiler-bridge_2.12/1.2.5/compiler-bridge_2.12-1.2.5-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.12/1.2.5/compiler-bridge_2.12-1.2.5-javadoc.jar"; sha256 = "58CAA3EAE25920DFBA5FACBC0C449CBA01994982E96C992D080E0EE52F886AE2"; @@ -2500,101 +2588,389 @@ url = "https://repo1.maven.org/maven2/org/scalacheck/scalacheck_2.12/1.14.3/scalacheck_2.12-1.14.3.pom"; sha256 = "ADACC7612985B59A41769D6A5A0D894839AFDAAE494C26CBC4C0984C9A8F87F6"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1-javadoc.jar"; - sha256 = "7C0EF9C23907D7261634CEBB6E5586F5AD37E30E1F118A764C6B2546F071A74F"; + "nix-public/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2-javadoc.jar"; + sha256 = "132C27C0CA68290C4507180A77372250F2A4654457E4223D041095A9BBFC61FE"; + }; + "nix-public/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2-sources.jar"; + sha256 = "C7F9FE80B487D7D7BEB5D122AF2CFD9BBB4B821FF66725757F4F84DCDB8F2F71"; + }; + "nix-public/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2.jar"; + sha256 = "B309D3B2FCAA8E85F6FBDBD03CBE65F966118095482402B5FE9F8F7527F3C6C7"; + }; + "nix-public/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.2.2/scalactic_2.12-3.2.2.pom"; + sha256 = "E8996A85BA1225FEA69237DEA1ADBFC6A7B47E61BA717273A602F538DBE80191"; + }; + "nix-public/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20-javadoc.jar"; + sha256 = "44335923904E3547FEAFDEB1F0FC843159D0AED05769D9C98C78927E180118F4"; + }; + "nix-public/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20-sources.jar"; + sha256 = "F7DD024A3D6042F91FE626AD0CEDB21B2BABE93EB4BCA36780A14C48CA667512"; + }; + "nix-public/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20.jar"; + sha256 = "75B77CF1B1072B7E90A7B1ACC995594027D75C0C21A25D11D5916D697BBABAEA"; + }; + "nix-public/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/common_2.12/4.3.20/common_2.12-4.3.20.pom"; + sha256 = "8E32462391C6CE92FB65494E9D21DC20FF09BAC8DB93619049A49AC6E6B59E93"; + }; + "nix-public/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1-javadoc.jar"; + sha256 = "7BC20CD5286CEF33B2CBDEF5846DA0898601309A1E4287497F0ACCE532605EFF"; + }; + "nix-public/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1-sources.jar"; + sha256 = "4EECADBF22E768E6D4771619B4BC9F1D0742B50B9A8CBA0BA53A5F9234CEDE09"; + }; + "nix-public/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1.jar"; + sha256 = "9D8AD97778EF9AEDEF5D4190879ED0EC54969E2FC951576FE18746AE6CE6CFCF"; + }; + "nix-public/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse-utils_2.12/1.0.1/fastparse-utils_2.12-1.0.1.pom"; + sha256 = "7AF20870E48ECAF9232FF134F187DFBD6F285C52831735C854FDCD34C2584EBD"; + }; + "nix-public/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1-javadoc.jar"; + sha256 = "B30F0060FC43A1B7D52E54AF66CED76CD4CAC55105F690E5B538F45EFC6E61F3"; + }; + "nix-public/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1-sources.jar"; + sha256 = "9ACEF7BF40DDF4B803DC77C9E96EE81A1FC0D5288C2E2731847B0D24FF978628"; + }; + "nix-public/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1.jar"; + sha256 = "387CED762E93915C5F87FED59D8453E404273F49F812D413405696CE20273AA5"; + }; + "nix-public/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/fastparse_2.12/1.0.1/fastparse_2.12-1.0.1.pom"; + sha256 = "98B9C9D145CEE8B2C50F95A5C03B1D7D9C3DD60884F3B1F07C9C7DDFDF23622F"; + }; + "nix-public/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20-javadoc.jar"; + sha256 = "30659B3AC2228DE1AD4AFF31550D9D61D700DA00C51601C1B4ECCD3E3C1F720F"; + }; + "nix-public/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20-sources.jar"; + sha256 = "196C5645416BD8C3D711A71D661F271AEFAFDF1265C7CD551F325001628C62AA"; + }; + "nix-public/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20.jar"; + sha256 = "BCFC98849A05903535F714C159AED52A220A30A3CC3C9C7429E13D7FD93865A6"; + }; + "nix-public/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/parsers_2.12/4.3.20/parsers_2.12-4.3.20.pom"; + sha256 = "52BDF1E0DF1E75D1008812936EFE27577AB064F5EDC2CBA6F8950489F6FDD3FA"; + }; + "nix-public/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20-javadoc.jar"; + sha256 = "405F1C335D4D0662F2C01D9480122085F324741540BF9F04C9AA663A3DBBA243"; + }; + "nix-public/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20-sources.jar"; + sha256 = "36D3343790DEBA7BBA119200D6CA8A2ACF791B2EA64C9CEF3D8F9F2EED6BC84A"; + }; + "nix-public/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20.jar"; + sha256 = "91B07C2DB03F60670B9305C176E33B30B2560B642F43314F7301C23FC4804833"; + }; + "nix-public/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/scalameta_2.12/4.3.20/scalameta_2.12-4.3.20.pom"; + sha256 = "C11455BB72ACAE72B748099088EC83E0EAEFB7452AACC639C705A319BA99D1F3"; + }; + "nix-public/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20-javadoc.jar"; + sha256 = "E3CB2602ED2D304A7B030100781C433FCA49652176B2DA3BFC738E08F15D81E5"; + }; + "nix-public/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20-sources.jar"; + sha256 = "D45D4D2046100AD54ADCBDDC3C63B72F859687E43CD86DB2BC5E6C8E337C34D3"; + }; + "nix-public/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20.jar" = { + url = "https://repo1.maven.org/maven2/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20.jar"; + sha256 = "0F697D3912C7B6A8D9F0B9E61AEA27A92784F07AED2578685E59D7D9D74A35E1"; + }; + "nix-public/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20.pom" = { + url = "https://repo1.maven.org/maven2/org/scalameta/trees_2.12/4.3.20/trees_2.12-4.3.20.pom"; + sha256 = "5B4598D69BFB96A5E45ECBD0BAFFE6471971C7813BA0D92C190193E88498F13C"; + }; + "nix-public/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0-javadoc.jar"; + sha256 = "1018E74C30D4DFE3B9E3A5CE94E41EC37A79D2B062D634AF85C6DF8B5F524DC6"; + }; + "nix-public/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0-sources.jar"; + sha256 = "84F4DB3F753FB8A431AC2D92CF939E6AD3962ECB7D642CA0143E5AB313E9D7CC"; + }; + "nix-public/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0.jar" = { + url = "https://repo1.maven.org/maven2/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0.jar"; + sha256 = "8124D9E868EB0FA34E7D05B5D5359EBA9901208C57A39342DD5F87BE253287F9"; + }; + "nix-public/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0.pom" = { + url = "https://repo1.maven.org/maven2/org/scalamock/scalamock_2.12/5.0.0/scalamock_2.12-5.0.0.pom"; + sha256 = "131134308971FF51B90D3591D8C26726B23CDB9CDF1C53F71E6B0E1010000F5A"; + }; + "nix-public/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2-javadoc.jar"; + sha256 = "7EB3AFB2E5C6D50F42A320C809D1000DD05B94B12C697CDD18AA8C6425FCD17F"; + }; + "nix-public/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2-sources.jar"; + sha256 = "9CD85B6D3907D159F383A23E617ED256E3AD65793262F96AD935954A0FD352E0"; + }; + "nix-public/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2.jar"; + sha256 = "0DDF9C164D29BA590FF67E83FF09D3A10AB8AC9E3FDC512AF7169B51EC0E7256"; + }; + "nix-public/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-compatible/3.2.2/scalatest-compatible-3.2.2.pom"; + sha256 = "285E1C62310DF89E3D4EC4A3317812B25E673FA52BDC0E4655EA6940BF2BF4B5"; + }; + "nix-public/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2-javadoc.jar"; + sha256 = "30ED32B545BE24F539576B4CEE444DD32C45AFAD0EEA5CD48338A5FD1C5891F7"; + }; + "nix-public/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2-sources.jar"; + sha256 = "ED693D930744ED81ACD48A10B15F207F7E9C7CD2C4D1F8E8FB490BFF11E58974"; + }; + "nix-public/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2.jar"; + sha256 = "C5A99AE05A30197E5B67972C3445187B918ADF3C6BC013239A6CEEF88B37ED36"; + }; + "nix-public/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-core_2.12/3.2.2/scalatest-core_2.12-3.2.2.pom"; + sha256 = "6E85AE78C7460DEFDFCD6904A0C9532417B0818165ABAAC701F9FAFBF19D1306"; + }; + "nix-public/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2-javadoc.jar"; + sha256 = "15A2C1072E6D0A77B1015B1C81A8F830C0238E17ED05113856ABBDC5B56462D4"; + }; + "nix-public/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2-sources.jar"; + sha256 = "2DEDCAC8FEEE81412E13B0A1239FDD8E35766B8798BEA9C9D0EBF4C6890B34A4"; + }; + "nix-public/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2.jar"; + sha256 = "441A5D668EDE6B4CB6EDA485690FC2C09E4BBA7A7A1312379348BD55ED11FC0B"; + }; + "nix-public/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-diagrams_2.12/3.2.2/scalatest-diagrams_2.12-3.2.2.pom"; + sha256 = "A26C99E456A95A50320C05FC3A173380901EDED06970623D92142877D0FF4794"; + }; + "nix-public/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2-javadoc.jar"; + sha256 = "CE6BA496D80D8DA4070FECC4B8661AC5544E64FE3842FB7717AD0818469F902F"; + }; + "nix-public/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2-sources.jar"; + sha256 = "F548B30657DFDCED96A9DE61E3313966D37F617B619D40905007342346F2BCF8"; + }; + "nix-public/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2.jar"; + sha256 = "77D98D12B698FCBFF70A8AD2B99EE7CC5B1A952EFEAE51E97B330B29F9283C8D"; + }; + "nix-public/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-featurespec_2.12/3.2.2/scalatest-featurespec_2.12-3.2.2.pom"; + sha256 = "B958A8DCE0D08AD6692D7D31F7683D6379AAC727BBDC7503988D39748F0DD3A1"; + }; + "nix-public/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2-javadoc.jar"; + sha256 = "19FCD1817EE6057B40094EB90CC6BFB5443041D612FB44741508297CF8DBD8A9"; + }; + "nix-public/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2-sources.jar"; + sha256 = "57C01617C3C8B0B9431FD0D79C8813F2831FC5DAA0A3DAACF6D74143E4928A79"; + }; + "nix-public/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2.jar"; + sha256 = "38075F25E78340C0813BFE0B2D5073AAF1BD76E0C361E1F8ACD4E5E415DFBAB0"; + }; + "nix-public/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-flatspec_2.12/3.2.2/scalatest-flatspec_2.12-3.2.2.pom"; + sha256 = "F5824355BD9F7394E5E21A614742F2E89F4417F839D186C095679103E88AD75C"; + }; + "nix-public/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2-javadoc.jar"; + sha256 = "83F190D16BFC8DA4A8B9581E26A519C85AE442C8DD37DF77A0164F3A287071FA"; + }; + "nix-public/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2-sources.jar"; + sha256 = "16A94DE7A61DEBF8F34C6DEDE52392A2F6B3AE90655226ACC5D68DB8B865DBAE"; + }; + "nix-public/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2.jar"; + sha256 = "8822A2FE6C5C502F67D0F8F457CE1626551937C65CFBA4207C728395BD60E576"; + }; + "nix-public/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-freespec_2.12/3.2.2/scalatest-freespec_2.12-3.2.2.pom"; + sha256 = "FCEE5348E62D68C14D8F6F3DE0D4ADCAEA3650CF1A3083ACF9E7799EEEC0E8ED"; + }; + "nix-public/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2-javadoc.jar"; + sha256 = "9B7830B4C90552CDDF0BD35FFC13CF55C99642D0F4A877599FED61F4B701D4CF"; + }; + "nix-public/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2-sources.jar"; + sha256 = "16FF48ABBFC8FA63AD3E3B4AF2B8901C3FB2AB136E940C84A6A16E3BA946066C"; + }; + "nix-public/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2.jar"; + sha256 = "060B5728F4938ABFEF474E7DBCE3259141831729AE67AB95B14F8B13B37EFBCB"; + }; + "nix-public/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funspec_2.12/3.2.2/scalatest-funspec_2.12-3.2.2.pom"; + sha256 = "9462CBE5E136058C49E137B61962B9D8A07A2FD6FBE8AAB30FF7DFA39AB93A1C"; + }; + "nix-public/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2-javadoc.jar"; + sha256 = "B799808DF058285BC4A3EE586AA623DFEEB0E1291AA3C12B4B9D20953487AD9F"; + }; + "nix-public/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2-sources.jar"; + sha256 = "C8A937C63B5237223E1A22F106AFA051FF16035664DB0CEF5FD9E260350FA1AB"; + }; + "nix-public/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2.jar"; + sha256 = "6C163EAB6605D84795ED056CEA9F1D1A8673767908FEDDAAAB18DAFD6FD80412"; + }; + "nix-public/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-funsuite_2.12/3.2.2/scalatest-funsuite_2.12-3.2.2.pom"; + sha256 = "24B2A159D2619084B18122F5055F92B2DF3AB678308079A1B97E2863CDFE809C"; + }; + "nix-public/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2-javadoc.jar"; + sha256 = "2A0362762892E49194C5F2131C1496F487C2FE49225D40AC8540B92EBC2D9D3B"; + }; + "nix-public/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2-sources.jar"; + sha256 = "F24C8B3C02D96357F1AFB5AC693F440AF5D6E1EB6B381661FD59ADDCDE63D4F3"; + }; + "nix-public/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2.jar"; + sha256 = "F34C1156D19D0735E4C84EC41FDDB7ED16CE46CA243F6282273E15813399384A"; + }; + "nix-public/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-matchers-core_2.12/3.2.2/scalatest-matchers-core_2.12-3.2.2.pom"; + sha256 = "1A63C3DF2A738BA37DDCAAC4122660C2B0E8254A0FD96E74BEAC8F576CDB5B48"; + }; + "nix-public/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2-javadoc.jar"; + sha256 = "8AB6B6C47EFC9428739FC4CB9E510326CBE2ADA1BB9818896D2DCBF300674EED"; + }; + "nix-public/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2-sources.jar"; + sha256 = "D8029810D468F7041F7CBF61F0C29B790F5809D72BA2E947B55E9199418184E3"; + }; + "nix-public/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2.jar"; + sha256 = "4CA44946491C37130610F89DA53918BD0F59FB809D551402ACD1E0E7A8C96DA0"; + }; + "nix-public/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-mustmatchers_2.12/3.2.2/scalatest-mustmatchers_2.12-3.2.2.pom"; + sha256 = "6551C3C7DD71232F17413A34B6D276942105CF1A913233C83542D99DC8261D68"; + }; + "nix-public/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2-javadoc.jar"; + sha256 = "978C79621D8C4EA53BCBF50B5B2514A04839D74A9BE350811AF5228F90A56689"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1-sources.jar"; - sha256 = "CCD4355939369346A6088B51898D37943317438C0C9E97D3A5098907AD7AB780"; + "nix-public/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2-sources.jar"; + sha256 = "2663801EB482EB9D998D15B8C1BED243B0FEAF05E920876D5919982DD71FAEE5"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1.jar"; - sha256 = "E4B28F505042F13AF90698DDF9950C574872CAB83DAAC34063516F648D008CB3"; + "nix-public/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2.jar"; + sha256 = "7CFD049A76F2A99D8DC8989F2B7070BD384B4FB034D02AB7204FC38231EB6D6F"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1.pom" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.1/scalactic_2.12-3.0.1.pom"; - sha256 = "4292DA45C391265B88D22F03C918A367505A728811B99834040C0D238BD4EB46"; + "nix-public/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-propspec_2.12/3.2.2/scalatest-propspec_2.12-3.2.2.pom"; + sha256 = "351B21167741C957E3F6AA0351CD508ECC5F73FF281AA24DC79AF047DE8F195D"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8-javadoc.jar"; - sha256 = "466086478EAC1F552992C0F18AAFAD5179D5FB4A56ECBB429B5E60C8C28401C9"; + "nix-public/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2-javadoc.jar"; + sha256 = "EDF028563992CA00519385853F9AB116C66D75E1915CBDD9AC79C501506A3524"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8-sources.jar"; - sha256 = "B591D7EEA2955EF9B78FE60E7EBD109AA239AE67103396A9449DFB549DABA74A"; + "nix-public/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2-sources.jar"; + sha256 = "910FD6CD9ED94728F7BA52DEF9DCF44DB7B3916DF56CCCAB08248B20BDFE259C"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8.jar" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8.jar"; - sha256 = "5F9AD122F54E9A0112FF4FCAADFB2802D8796F5DDE021CAA4C831067FCA68469"; + "nix-public/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2.jar"; + sha256 = "58553B166D9EF2740A0EC5FD965924457EAB75FDF2275E7A06572625CAECEF15"; }; - "nix-public/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8.pom" = { - url = "https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.8/scalactic_2.12-3.0.8.pom"; - sha256 = "C20AE1BEECB418B5F411E9D1357FC0E97A789BB9444521D30F8E2C334D47A45D"; + "nix-public/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-refspec_2.12/3.2.2/scalatest-refspec_2.12-3.2.2.pom"; + sha256 = "4EED1AE9C3C621428AD915B1AD668362F0FE5FC7C57BB129945FDBF142CECAC2"; }; - "nix-public/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0-javadoc.jar"; - sha256 = "F8E762D2BC428530F9F8AFAF51293047741D8E5791247CAAF3FC8A415DC4079E"; + "nix-public/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2-javadoc.jar"; + sha256 = "6712E61D5AE67D0D9303530B3FEAF060DA1333397794E545377F3185C91EE07F"; }; - "nix-public/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0-sources.jar"; - sha256 = "D117F1927AA561E3D078688677254DE085D088AC9EE1B6A6BE61E4779F3B121D"; + "nix-public/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2-sources.jar"; + sha256 = "E319552D5B1977B285702BBB42572D66FB4769E2BA51431A747065B53773065F"; }; - "nix-public/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0.jar"; - sha256 = "53992E1B6B0433DAEC4C5A9F432EE3D1249BD8830332107E57C1DDBF2BCD672D"; + "nix-public/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2.jar"; + sha256 = "29B379A5C6413928C8F4C6438CB8E54C8E37DBD649DCCDEF2541C68D7271A954"; }; - "nix-public/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0.pom" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-core_2.12/3.6.0/scalamock-core_2.12-3.6.0.pom"; - sha256 = "DC92D36DAEC6EDBA573C8D6AFD1242E44FDEC2948CC52C3FE924DA462CA752F3"; + "nix-public/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-shouldmatchers_2.12/3.2.2/scalatest-shouldmatchers_2.12-3.2.2.pom"; + sha256 = "54779E687EEF1730716E4C89607BA56303A889C5F9CD31E14B46F9FDEB964E19"; }; - "nix-public/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0-javadoc.jar"; - sha256 = "A18BC13001D3ADF0F925679AF4C25F1A9F148461E2B2F0C13E5B488D4B666F4F"; + "nix-public/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2-javadoc.jar"; + sha256 = "D1FC2E97E17ECB1E0ED79E993B58466CB7A90C9E907F2CFFD6DB657A5BBF9E0A"; }; - "nix-public/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0-sources.jar"; - sha256 = "934B60DCFB6DEEE2B59DA1928E0ECB0ECB97EE317CF0D1AE02FCB2C15EBD3397"; + "nix-public/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2-sources.jar"; + sha256 = "11E443F1B843FF9320A9CF3A8BF61213A47D21AE44A89BF4F6808907AC09484F"; }; - "nix-public/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0.jar" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0.jar"; - sha256 = "5D27C4C5684228BE918E49D198C0E0279BC2D91A22ED7481AF7538DA82FAF1C7"; + "nix-public/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2.jar"; + sha256 = "AA6705F446BF267423BA277B47639C340646FF278681928FAEB7C4A000D964BF"; }; - "nix-public/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0.pom" = { - url = "https://repo1.maven.org/maven2/org/scalamock/scalamock-scalatest-support_2.12/3.6.0/scalamock-scalatest-support_2.12-3.6.0.pom"; - sha256 = "F0093E8844AA93A86846FE2F998C8EF3D499D97521CDC9B9E977BF2E80FDE0F7"; + "nix-public/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest-wordspec_2.12/3.2.2/scalatest-wordspec_2.12-3.2.2.pom"; + sha256 = "354C0D92CFC73E79582678DA5A473E84609E9BB4D08DEF0D622A21E1BC7B327B"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1-javadoc.jar"; - sha256 = "010A9626869A5F4D745A16E15C3CB99E0E4FCC515561C2E46515CA00DBA17BE2"; + "nix-public/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2-javadoc.jar"; + sha256 = "C9729CA2ADA7D13C2E64E79391CB266E9DB09C85CEA55E59AC4C4F0DEF7C212A"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1-sources.jar"; - sha256 = "BA94C61217D67F38D8F70326F03E93542C3AC28BBDEBD63B6AF9C7946B60A615"; + "nix-public/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2-sources.jar"; + sha256 = "44E385E8D438B6E71161EBF2A95FCACF4E335786AA007612171240A80BC05108"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.jar"; - sha256 = "47B8B0A75B9F127CF1DF6C9E3547487F13487DEED946A682DACF56B923F1F24A"; + "nix-public/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2.jar"; + sha256 = "70120CC59FFFED5F08CA68C33F887ACA5BCA1EC01341B7D6223C5C830B22936A"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.pom" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.pom"; - sha256 = "073D2541ED6E8AE21FDE66A86AE1A1C18C8E802129199E050F4032A9D6F9AC6B"; + "nix-public/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.2.2/scalatest_2.12-3.2.2.pom"; + sha256 = "534270DD8CB00CABAB63588C71073B98D55A184FC5841BE8844C91FFE9E18163"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8-javadoc.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8-javadoc.jar"; - sha256 = "B5D0C220375CA607F9E99AE4A0D48AE46BADF9F86CCCC7E96432C5615BA1B150"; + "nix-public/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0-javadoc.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0-javadoc.jar"; + sha256 = "9BD185EE936488B6EC21797B22D0D2912799C2A1DD973C2B544A5AAD579D0E3D"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8-sources.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8-sources.jar"; - sha256 = "F23DA5F345251F6B8BEE14A458ECBD92F04D7AA034DA2909C3B1E8EDDE70D7BF"; + "nix-public/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0-sources.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0-sources.jar"; + sha256 = "F951C4DD58DBCB95F1046628B4A183F47901EF3650C5E19DA60ED8D50ADE0951"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8.jar" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8.jar"; - sha256 = "A4045CEA66F3EAAB525696F3000D7D610593778BD070E98349A7066F872844CD"; + "nix-public/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0.jar" = { + url = "https://repo1.maven.org/maven2/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0.jar"; + sha256 = "4886DC341113EFBEDF5F0977010BB962BB10E7B655A48120971CE8E2CA6C9DF6"; }; - "nix-public/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8.pom" = { - url = "https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.8/scalatest_2.12-3.0.8.pom"; - sha256 = "2FBACCB456C601F7BFBF268D88FDDC25BA797B42FA0ACB8AA0570922177D66CA"; + "nix-public/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0.pom" = { + url = "https://repo1.maven.org/maven2/org/scalatestplus/scalacheck-1-14_2.12/3.2.2.0/scalacheck-1-14_2.12-3.2.2.0.pom"; + sha256 = "D3ECC650284D8F01243D8A5F4F238E8459024942299CD7207FAEBCE5CDF5B087"; }; "nix-public/org/slf4j/slf4j-api/1.7.22/slf4j-api-1.7.22-javadoc.jar" = { url = "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.22/slf4j-api-1.7.22-javadoc.jar"; diff --git a/src/benchmark/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeSpeedSpec.scala b/src/benchmark/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeSpeedSpec.scala index f1e996bf6b..2ee0751188 100644 --- a/src/benchmark/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeSpeedSpec.scala +++ b/src/benchmark/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeSpeedSpec.scala @@ -6,11 +6,11 @@ import io.iohk.ethereum.mpt.MerklePatriciaTrie.defaultByteArraySerializable import io.iohk.ethereum.utils.Logger import io.iohk.ethereum.{ObjectGenerators, crypto} import org.bouncycastle.util.encoders.Hex -import org.scalatest.FunSuite +import org.scalatest.funsuite.AnyFunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks class MerklePatriciaTreeSpeedSpec - extends FunSuite + extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators with Logger diff --git a/src/benchmark/scala/io/iohk/ethereum/rlp/RLPSpeedSuite.scala b/src/benchmark/scala/io/iohk/ethereum/rlp/RLPSpeedSuite.scala index e869e816f3..cee8835aed 100644 --- a/src/benchmark/scala/io/iohk/ethereum/rlp/RLPSpeedSuite.scala +++ b/src/benchmark/scala/io/iohk/ethereum/rlp/RLPSpeedSuite.scala @@ -7,8 +7,8 @@ import io.iohk.ethereum.domain._ import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._ import io.iohk.ethereum.utils.Logger import org.scalacheck.Gen -import org.scalatest.FunSuite import org.bouncycastle.util.encoders.Hex +import org.scalatest.funsuite.AnyFunSuite import org.scalatestplus.scalacheck.{ScalaCheckDrivenPropertyChecks, ScalaCheckPropertyChecks} /** @@ -17,7 +17,7 @@ import org.scalatestplus.scalacheck.{ScalaCheckDrivenPropertyChecks, ScalaCheckP * - https://github.com/ethereum/pyrlp/blob/develop/tests/speed.py */ class RLPSpeedSuite - extends FunSuite + extends AnyFunSuite with ScalaCheckPropertyChecks with ScalaCheckDrivenPropertyChecks with ObjectGenerators diff --git a/src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainSuite.scala b/src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainSuite.scala index f809f769c4..ae1b329eaa 100644 --- a/src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainSuite.scala +++ b/src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainSuite.scala @@ -1,6 +1,7 @@ package io.iohk.ethereum.ets.blockchain import java.util.concurrent.Executors + import akka.actor.ActorSystem import io.iohk.ethereum.domain.Block import io.iohk.ethereum.ets.common.TestOptions @@ -8,7 +9,10 @@ import io.iohk.ethereum.extvm.ExtVMInterface import io.iohk.ethereum.ledger.Ledger.VMImpl import io.iohk.ethereum.nodebuilder.VmSetup import io.iohk.ethereum.utils.{Config, Logger, VmConfig} -import org.scalatest._ +import org.scalatest.{Args, BeforeAndAfterAll, Status} +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers + import scala.concurrent.duration.Duration import scala.concurrent.{Await, ExecutionContext, Future} @@ -18,7 +22,7 @@ object BlockchainSuite { lazy val extvm: VMImpl = VmSetup.vm(VmConfig(Config.config), Config.blockchains.blockchainConfig, testMode = true) } -class BlockchainSuite extends FreeSpec with Matchers with BeforeAndAfterAll with Logger { +class BlockchainSuite extends AnyFreeSpec with Matchers with BeforeAndAfterAll with Logger { import BlockchainSuite.testContext val unsupportedNetworks: Set[String] = Set( @@ -60,7 +64,7 @@ class BlockchainSuite extends FreeSpec with Matchers with BeforeAndAfterAll with cancel(s"Unsupported network: ${scenario.network}") } else if (!supportedNetworks.contains(scenario.network)) { fail(s"Unknown network: ${scenario.network}") - } else if (isCanceled(group.name, name)){ + } else if (isCanceled(group.name, name)) { cancel(s"Test: $name in group: ${group.name} not yet supported") } else { log.info(s"Running test: ${group.name}#$name") @@ -82,7 +86,9 @@ class BlockchainSuite extends FreeSpec with Matchers with BeforeAndAfterAll with } private def isCanceled(groupName: String, testName: String): Boolean = - ignoredTests.get(groupName).isDefined && (ignoredTests(groupName).contains(testName) || ignoredTests(groupName).isEmpty) + ignoredTests.get(groupName).isDefined && (ignoredTests(groupName).contains(testName) || ignoredTests( + groupName + ).isEmpty) private def runScenario(scenario: BlockchainScenario, setup: ScenarioSetup, name: String): Unit = { @@ -110,7 +116,9 @@ class BlockchainSuite extends FreeSpec with Matchers with BeforeAndAfterAll with val lastBlock = getBestBlock val expectedWorldStateHash = - scenario.postStateHash.orElse(finalWorld.map(_.stateRootHash)).getOrElse(throw new IllegalStateException("postState or PostStateHash not defined")) + scenario.postStateHash + .orElse(finalWorld.map(_.stateRootHash)) + .getOrElse(throw new IllegalStateException("postState or PostStateHash not defined")) lastBlock shouldBe defined diff --git a/src/ets/scala/io/iohk/ethereum/ets/vm/VMSuite.scala b/src/ets/scala/io/iohk/ethereum/ets/vm/VMSuite.scala index d477f201a5..88346524e8 100644 --- a/src/ets/scala/io/iohk/ethereum/ets/vm/VMSuite.scala +++ b/src/ets/scala/io/iohk/ethereum/ets/vm/VMSuite.scala @@ -1,6 +1,7 @@ package io.iohk.ethereum.ets.vm import akka.util.ByteString +import io.iohk.ethereum.crypto.kec256 import io.iohk.ethereum.domain.TxLogEntry import io.iohk.ethereum.ets.common.TestOptions import io.iohk.ethereum.network.p2p.messages.PV63.TxLogEntryImplicits._ @@ -8,10 +9,11 @@ import io.iohk.ethereum.rlp._ import io.iohk.ethereum.utils.Logger import io.iohk.ethereum.vm.MockWorldState._ import io.iohk.ethereum.vm._ -import io.iohk.ethereum.crypto.kec256 import org.scalatest._ +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers -class VMSuite extends FreeSpec with Matchers with Logger { +class VMSuite extends AnyFreeSpec with Matchers with Logger { val vm = new TestVM @@ -79,7 +81,9 @@ class VMSuite extends FreeSpec with Matchers with Logger { result.internalTxs.flatMap(internalTxToCallCreate) shouldEqual callcreates } - if (scenario.gas.isEmpty && scenario.out.isEmpty && scenario.callcreates.isEmpty && scenario.post.isEmpty && scenario.logs.isEmpty) { + if ( + scenario.gas.isEmpty && scenario.out.isEmpty && scenario.callcreates.isEmpty && scenario.post.isEmpty && scenario.logs.isEmpty + ) { result.error.isDefined shouldBe true } } diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/CallSelfDestructSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/CallSelfDestructSpec.scala index f9f91cd656..628de244bb 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/CallSelfDestructSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/CallSelfDestructSpec.scala @@ -1,9 +1,10 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} +import org.scalatest.matchers.should.Matchers +import org.scalatest.freespec.AnyFreeSpec -class CallSelfDestructSpec extends FreeSpec with Matchers { +class CallSelfDestructSpec extends AnyFreeSpec with Matchers { "EVM running CallSelfDestruct contract" - { diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/CallerSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/CallerSpec.scala index 1abb81e705..5d5af4c990 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/CallerSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/CallerSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} +import org.scalatest.matchers.should.Matchers +import org.scalatest.freespec.AnyFreeSpec import io.iohk.ethereum.domain.UInt256 // scalastyle:off magic.number -class CallerSpec extends FreeSpec with Matchers { +class CallerSpec extends AnyFreeSpec with Matchers { "EVM running Caller contract" - { diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/ContractCallingItselfSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/ContractCallingItselfSpec.scala index eb8b973c06..190d6b6c4b 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/ContractCallingItselfSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/ContractCallingItselfSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} +import org.scalatest.matchers.should.Matchers +import org.scalatest.freespec.AnyFreeSpec import io.iohk.ethereum.domain.UInt256 // scalastyle:off magic.number -class ContractCallingItselfSpec extends FreeSpec with Matchers { +class ContractCallingItselfSpec extends AnyFreeSpec with Matchers { "EVM running ContractCallingItself contract" - { diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/FibonacciSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/FibonacciSpec.scala index 9da2fdf2b9..29e8091da5 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/FibonacciSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/FibonacciSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} +import org.scalatest.matchers.should.Matchers +import org.scalatest.freespec.AnyFreeSpec import io.iohk.ethereum.domain.UInt256 // scalastyle:off magic.number -class FibonacciSpec extends FreeSpec with Matchers { +class FibonacciSpec extends AnyFreeSpec with Matchers { "EVM running Fibonacci contract" - { diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/MinimumViableTokenSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/MinimumViableTokenSpec.scala index e9db486c69..e660d7117a 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/MinimumViableTokenSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/MinimumViableTokenSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} import io.iohk.ethereum.domain.UInt256 +import org.scalatest.matchers.should.Matchers +import org.scalatest.freespec.AnyFreeSpec // scalastyle:off magic.number -class MinimumViableTokenSpec extends FreeSpec with Matchers { +class MinimumViableTokenSpec extends AnyFreeSpec with Matchers { "EVM running MinimumViableToken contract" - { @@ -38,8 +39,8 @@ class MinimumViableTokenSpec extends FreeSpec with Matchers { val sender = createAccount(balance = 10) val receiver = createAccount(balance = 10) - val (result, _) = deployContract("MinimumViableToken", creatorAddress = sender, - constructorArgs = Seq(100), gasLimit = 102934) + val (result, _) = + deployContract("MinimumViableToken", creatorAddress = sender, constructorArgs = Seq(100), gasLimit = 102934) result.error shouldBe Some(OutOfGas) } diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/MutualRecursionSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/MutualRecursionSpec.scala index 80a3bbe003..4d60a4c8f9 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/MutualRecursionSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/MutualRecursionSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} import io.iohk.ethereum.domain.UInt256 +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number -class MutualRecursionSpec extends FreeSpec with Matchers { +class MutualRecursionSpec extends AnyFreeSpec with Matchers { "EVM running MutualRecursion contract" - { diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/PrecompiledContractsSpecEvm.scala b/src/evmTest/scala/io/iohk/ethereum/vm/PrecompiledContractsSpecEvm.scala index 03a304817f..1d7f2cefc0 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/PrecompiledContractsSpecEvm.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/PrecompiledContractsSpecEvm.scala @@ -6,10 +6,11 @@ import io.iohk.ethereum.crypto._ import io.iohk.ethereum.domain.SignedTransaction.{FirstByteOfAddress, LastByteOfAddress} import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FunSuite, Matchers} import org.bouncycastle.crypto.params.ECPublicKeyParameters +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class PrecompiledContractsSpecEvm extends FunSuite with Matchers with SecureRandomBuilder { +class PrecompiledContractsSpecEvm extends AnyFunSuite with Matchers with SecureRandomBuilder { test("Precompiled Contracts") { val keyPair = generateKeyPair(secureRandom) diff --git a/src/evmTest/scala/io/iohk/ethereum/vm/ThrowSpec.scala b/src/evmTest/scala/io/iohk/ethereum/vm/ThrowSpec.scala index 76e1a9835b..5e7e04ca95 100644 --- a/src/evmTest/scala/io/iohk/ethereum/vm/ThrowSpec.scala +++ b/src/evmTest/scala/io/iohk/ethereum/vm/ThrowSpec.scala @@ -1,10 +1,11 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.utils.EvmTestEnv -import org.scalatest.{FreeSpec, Matchers} +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number -class ThrowSpec extends FreeSpec with Matchers { +class ThrowSpec extends AnyFreeSpec with Matchers { "EVM running Throw contract" - { diff --git a/src/it/scala/io/iohk/ethereum/db/DataSourceIntegrationTestBehavior.scala b/src/it/scala/io/iohk/ethereum/db/DataSourceIntegrationTestBehavior.scala index ff454aecc6..bfa966c067 100644 --- a/src/it/scala/io/iohk/ethereum/db/DataSourceIntegrationTestBehavior.scala +++ b/src/it/scala/io/iohk/ethereum/db/DataSourceIntegrationTestBehavior.scala @@ -2,16 +2,17 @@ package io.iohk.ethereum.db import java.io.File import java.nio.file.Files + import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.{DataSource, DataSourceUpdate} import io.iohk.ethereum.db.dataSource.DataSource.{Key, Namespace, Value} -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with ObjectGenerators { - this: FlatSpec => + this: AnyFlatSpec => val KeySizeWithoutPrefix: Int = 32 val KeySize: Int = KeySizeWithoutPrefix + 1 @@ -32,15 +33,15 @@ trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with Ob } def prepareUpdate( - namespace: Namespace = OtherNamespace, - toRemove: Seq[Key] = Nil, - toUpsert: Seq[(Key, Value)] = Nil + namespace: Namespace = OtherNamespace, + toRemove: Seq[Key] = Nil, + toUpsert: Seq[(Key, Value)] = Nil ): Seq[DataSourceUpdate] = Seq(DataSourceUpdate(namespace, toRemove, toUpsert)) def updateInSeparateCalls( - dataSource: DataSource, - toUpsert: Seq[(ByteString, ByteString)] + dataSource: DataSource, + toUpsert: Seq[(ByteString, ByteString)] ): Unit = { toUpsert.foreach { keyValuePair => dataSource.update(prepareUpdate(toUpsert = Seq(keyValuePair))) @@ -93,9 +94,8 @@ trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with Ob val keyListWithExtraByte = keyList.map(1.toByte +: _) updateInSeparateCalls(db, keyList.zip(keyListWithExtraByte)) - keyList.zip(keyListWithExtraByte).foreach { - case (key, value) => - assert(db.get(OtherNamespace, key).contains(value)) + keyList.zip(keyListWithExtraByte).foreach { case (key, value) => + assert(db.get(OtherNamespace, key).contains(value)) } db.destroy() @@ -113,9 +113,8 @@ trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with Ob val keyListWithExtraByte = keyList.map(1.toByte +: _) db.update(prepareUpdate(toUpsert = keyList.zip(keyListWithExtraByte))) - keyList.zip(keyListWithExtraByte).foreach { - case (key, value) => - assert(db.get(OtherNamespace, key).contains(value)) + keyList.zip(keyListWithExtraByte).foreach { case (key, value) => + assert(db.get(OtherNamespace, key).contains(value)) } db.destroy() @@ -191,9 +190,8 @@ trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with Ob val valList2 = keyList.map(2.toByte +: _) db.update(prepareUpdate(namespace = OtherNamespace2, toUpsert = keyList.zip(valList2))) - keyList.zip(valList1).foreach { - case (key, value) => - assert(db.get(OtherNamespace, key).contains(value)) + keyList.zip(valList1).foreach { case (key, value) => + assert(db.get(OtherNamespace, key).contains(value)) } keyList.zip(valList2).foreach { case (key, value) => assert(db.get(OtherNamespace2, key).contains(value)) @@ -223,9 +221,8 @@ trait DataSourceIntegrationTestBehavior extends ScalaCheckPropertyChecks with Ob keyList.foreach { key => assert(db.get(OtherNamespace, key).isEmpty) } - keyList.zip(valList2).foreach { - case (key, value) => - assert(db.get(OtherNamespace2, key).contains(value)) + keyList.zip(valList2).foreach { case (key, value) => + assert(db.get(OtherNamespace2, key).contains(value)) } //Removal of keys from the OtherNamespace2 namespace diff --git a/src/it/scala/io/iohk/ethereum/db/RocksDbDataSourceIntegrationSuite.scala b/src/it/scala/io/iohk/ethereum/db/RocksDbDataSourceIntegrationSuite.scala index 600a973a6f..05e6544da6 100644 --- a/src/it/scala/io/iohk/ethereum/db/RocksDbDataSourceIntegrationSuite.scala +++ b/src/it/scala/io/iohk/ethereum/db/RocksDbDataSourceIntegrationSuite.scala @@ -2,22 +2,24 @@ package io.iohk.ethereum.db import io.iohk.ethereum.db.dataSource.{RocksDbConfig, RocksDbDataSource} import io.iohk.ethereum.db.storage.Namespaces -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec -class RocksDbDataSourceIntegrationSuite extends FlatSpec with DataSourceIntegrationTestBehavior { +class RocksDbDataSourceIntegrationSuite extends AnyFlatSpec with DataSourceIntegrationTestBehavior { - private def createDataSource(dataSourcePath: String) = RocksDbDataSource(new RocksDbConfig { - override val createIfMissing: Boolean = true - override val paranoidChecks: Boolean = true - override val path: String = dataSourcePath - override val maxThreads: Int = 1 - override val maxOpenFiles: Int = 32 - override val verifyChecksums: Boolean = true - override val levelCompaction: Boolean = true - override val blockSize: Long = 16384 - override val blockCacheSize: Long = 33554432 - }, Namespaces.nsSeq) + private def createDataSource(dataSourcePath: String) = RocksDbDataSource( + new RocksDbConfig { + override val createIfMissing: Boolean = true + override val paranoidChecks: Boolean = true + override val path: String = dataSourcePath + override val maxThreads: Int = 1 + override val maxOpenFiles: Int = 32 + override val verifyChecksums: Boolean = true + override val levelCompaction: Boolean = true + override val blockSize: Long = 16384 + override val blockCacheSize: Long = 33554432 + }, + Namespaces.nsSeq + ) it should behave like dataSource(createDataSource) } - diff --git a/src/it/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeIntegrationSuite.scala b/src/it/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeIntegrationSuite.scala index 8db8e526e7..68e5a0e2ec 100644 --- a/src/it/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeIntegrationSuite.scala +++ b/src/it/scala/io/iohk/ethereum/mpt/MerklePatriciaTreeIntegrationSuite.scala @@ -2,16 +2,18 @@ package io.iohk.ethereum.mpt import java.nio.ByteBuffer import java.security.MessageDigest + import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.mpt.MerklePatriciaTrie._ import io.iohk.ethereum.utils.Logger import org.bouncycastle.util.encoders.Hex -import org.scalatest.FunSuite +import org.scalatest.funsuite.AnyFunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks + import scala.util.Random class MerklePatriciaTreeIntegrationSuite - extends FunSuite + extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators with Logger diff --git a/src/it/scala/io/iohk/ethereum/sync/FastSyncItSpec.scala b/src/it/scala/io/iohk/ethereum/sync/FastSyncItSpec.scala index a2486f5803..1567ee795e 100644 --- a/src/it/scala/io/iohk/ethereum/sync/FastSyncItSpec.scala +++ b/src/it/scala/io/iohk/ethereum/sync/FastSyncItSpec.scala @@ -29,7 +29,14 @@ import io.iohk.ethereum.network.p2p.EthereumMessageDecoder import io.iohk.ethereum.network.p2p.messages.CommonMessages.NewBlock import io.iohk.ethereum.network.rlpx.AuthHandshaker import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration -import io.iohk.ethereum.network.{EtcPeerManagerActor, ForkResolver, KnownNodesManager, PeerEventBusActor, PeerManagerActor, ServerActor} +import io.iohk.ethereum.network.{ + EtcPeerManagerActor, + ForkResolver, + KnownNodesManager, + PeerEventBusActor, + PeerManagerActor, + ServerActor +} import io.iohk.ethereum.nodebuilder.{PruningConfigBuilder, SecureRandomBuilder} import io.iohk.ethereum.sync.FastSyncItSpec.{FakePeer, IdentityUpdate, updateStateAtBlock} import io.iohk.ethereum.utils.ServerStatus.Listening @@ -38,7 +45,8 @@ import io.iohk.ethereum.vm.EvmConfig import io.iohk.ethereum.{Fixtures, FlatSpecBase, Timeouts} import monix.eval.Task import monix.execution.Scheduler -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ import scala.util.Try @@ -46,18 +54,19 @@ import scala.util.Try class FastSyncItSpec extends FlatSpecBase with Matchers with BeforeAndAfter { implicit val testScheduler = Scheduler.fixedPool("test", 16) - "FastSync" should "should sync blockchain without state nodes" in customTestCaseResourceM(FakePeer.start3FakePeersRes()) { - case (peer1, peer2, peer3) => - for { - _ <- peer2.importBlocksUntil(1000)(IdentityUpdate) - _ <- peer3.importBlocksUntil(1000)(IdentityUpdate) - _ <- peer1.connectToPeers(Set(peer2.node, peer3.node)) - _ <- peer1.startFastSync().delayExecution(50.milliseconds) - _ <- peer1.waitForFastSyncFinish() - } yield { - assert(peer1.bl.getBestBlockNumber() == peer2.bl.getBestBlockNumber() - peer2.testSyncConfig.targetBlockOffset) - assert(peer1.bl.getBestBlockNumber() == peer3.bl.getBestBlockNumber() - peer3.testSyncConfig.targetBlockOffset) - } + "FastSync" should "should sync blockchain without state nodes" in customTestCaseResourceM( + FakePeer.start3FakePeersRes() + ) { case (peer1, peer2, peer3) => + for { + _ <- peer2.importBlocksUntil(1000)(IdentityUpdate) + _ <- peer3.importBlocksUntil(1000)(IdentityUpdate) + _ <- peer1.connectToPeers(Set(peer2.node, peer3.node)) + _ <- peer1.startFastSync().delayExecution(50.milliseconds) + _ <- peer1.waitForFastSyncFinish() + } yield { + assert(peer1.bl.getBestBlockNumber() == peer2.bl.getBestBlockNumber() - peer2.testSyncConfig.targetBlockOffset) + assert(peer1.bl.getBestBlockNumber() == peer3.bl.getBestBlockNumber() - peer3.testSyncConfig.targetBlockOffset) + } } it should "should sync blockchain with state nodes" in customTestCaseResourceM(FakePeer.start3FakePeersRes()) { @@ -78,7 +87,6 @@ class FastSyncItSpec extends FlatSpecBase with Matchers with BeforeAndAfter { } } - it should "should update target block" in customTestCaseResourceM(FakePeer.start2FakePeersRes()) { case (peer1, peer2) => for { @@ -95,7 +103,7 @@ class FastSyncItSpec extends FlatSpecBase with Matchers with BeforeAndAfter { object FastSyncItSpec { private def retryUntilWithDelay[A](source: Task[A], delay: FiniteDuration, maxRetries: Int)( - predicate: A => Boolean + predicate: A => Boolean ): Task[A] = { source.delayExecution(delay).flatMap { result => if (predicate(result)) { @@ -123,7 +131,7 @@ object FastSyncItSpec { val IdentityUpdate: (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy = (_, world) => world - def updateWorldWithNAccounts(n:Int, world: InMemoryWorldStateProxy): InMemoryWorldStateProxy = { + def updateWorldWithNAccounts(n: Int, world: InMemoryWorldStateProxy): InMemoryWorldStateProxy = { val resultWorld = (0 until n).foldLeft(world) { (world, num) => val randomBalance = num val randomAddress = Address(num) @@ -138,12 +146,13 @@ object FastSyncItSpec { InMemoryWorldStateProxy.persistState(resultWorld) } - def updateStateAtBlock(blockWithUpdate: BigInt): (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy = { (blockNr: BigInt, world: InMemoryWorldStateProxy) => - if (blockNr == blockWithUpdate) { - updateWorldWithNAccounts(1000, world) - } else { - IdentityUpdate(blockNr, world) - } + def updateStateAtBlock(blockWithUpdate: BigInt): (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy = { + (blockNr: BigInt, world: InMemoryWorldStateProxy) => + if (blockNr == blockWithUpdate) { + updateWorldWithNAccounts(1000, world) + } else { + IdentityUpdate(blockNr, world) + } } class FakePeer(peerName: String) extends SecureRandomBuilder with TestSyncConfig { @@ -187,10 +196,14 @@ object FastSyncItSpec { } lazy val nodeStatusHolder = new AtomicReference(nodeStatus) - lazy val storagesInstance = new RocksDbDataSourceComponent with LocalPruningConfigBuilder with Storages.DefaultStorages { - override lazy val dataSource: RocksDbDataSource = RocksDbDataSource(getRockDbTestConfig(tempDir.toAbsolutePath.toString), Namespaces.nsSeq) + lazy val storagesInstance = new RocksDbDataSourceComponent + with LocalPruningConfigBuilder + with Storages.DefaultStorages { + override lazy val dataSource: RocksDbDataSource = + RocksDbDataSource(getRockDbTestConfig(tempDir.toAbsolutePath.toString), Namespaces.nsSeq) } lazy val blockchainConfig = Config.blockchains.blockchainConfig + /** * Default persist interval is 20s, which is too long for tests. As in all tests we treat peer as connected when * it is persisted in storage. @@ -207,7 +220,10 @@ object FastSyncItSpec { val bl = BlockchainImpl(storagesInstance.storages) - val genesis = Block(Fixtures.Blocks.Genesis.header.copy(stateRoot = ByteString(MerklePatriciaTrie.EmptyRootHash) ), Fixtures.Blocks.Genesis.body) + val genesis = Block( + Fixtures.Blocks.Genesis.header.copy(stateRoot = ByteString(MerklePatriciaTrie.EmptyRootHash)), + Fixtures.Blocks.Genesis.body + ) bl.save(genesis, Seq(), genesis.header.difficulty, saveAsBestBlock = true) @@ -256,32 +272,40 @@ object FastSyncItSpec { lazy val authHandshaker: AuthHandshaker = AuthHandshaker(nodeKey, secureRandom) - lazy val peerManager: ActorRef = system.actorOf(PeerManagerActor.props( - peerDiscoveryManager, - Config.Network.peer, - peerEventBus, - knownNodesManager, - handshaker, - authHandshaker, - EthereumMessageDecoder - ), "peer-manager") + lazy val peerManager: ActorRef = system.actorOf( + PeerManagerActor.props( + peerDiscoveryManager, + Config.Network.peer, + peerEventBus, + knownNodesManager, + handshaker, + authHandshaker, + EthereumMessageDecoder + ), + "peer-manager" + ) - lazy val etcPeerManager: ActorRef = system.actorOf(EtcPeerManagerActor.props( - peerManager, peerEventBus, storagesInstance.storages.appStateStorage, None), "etc-peer-manager") + lazy val etcPeerManager: ActorRef = system.actorOf( + EtcPeerManagerActor.props(peerManager, peerEventBus, storagesInstance.storages.appStateStorage, None), + "etc-peer-manager" + ) - val blockchainHost: ActorRef = system.actorOf(BlockchainHostActor.props( - bl, peerConf, peerEventBus, etcPeerManager), "blockchain-host") + val blockchainHost: ActorRef = + system.actorOf(BlockchainHostActor.props(bl, peerConf, peerEventBus, etcPeerManager), "blockchain-host") lazy val server: ActorRef = system.actorOf(ServerActor.props(nodeStatusHolder, peerManager), "server") val listenAddress = randomAddress() lazy val node = - DiscoveryNodeInfo(Node(ByteString(nodeStatus.nodeId), listenAddress.getAddress, listenAddress.getPort, listenAddress.getPort), 1) + DiscoveryNodeInfo( + Node(ByteString(nodeStatus.nodeId), listenAddress.getAddress, listenAddress.getPort, listenAddress.getPort), + 1 + ) lazy val vmConfig = VmConfig(Config.config) - lazy val validators= new MockValidatorsAlwaysSucceed + lazy val validators = new MockValidatorsAlwaysSucceed val testSyncConfig = syncConfig.copy( minPeersToChooseTargetBlock = 1, @@ -298,18 +322,22 @@ object FastSyncItSpec { lazy val broadcaster = new BlockBroadcast(etcPeerManager, testSyncConfig) - lazy val broadcasterActor = system.actorOf(BlockBroadcasterActor.props(broadcaster, peerEventBus, etcPeerManager, testSyncConfig, system.scheduler)) + lazy val broadcasterActor = system.actorOf( + BlockBroadcasterActor.props(broadcaster, peerEventBus, etcPeerManager, testSyncConfig, system.scheduler) + ) - lazy val fastSync = system.actorOf(FastSync.props( - storagesInstance.storages.fastSyncStateStorage, - storagesInstance.storages.appStateStorage, - bl, - validators, - peerEventBus, - etcPeerManager, - testSyncConfig, - system.scheduler - )) + lazy val fastSync = system.actorOf( + FastSync.props( + storagesInstance.storages.fastSyncStateStorage, + storagesInstance.storages.appStateStorage, + bl, + validators, + peerEventBus, + etcPeerManager, + testSyncConfig, + system.scheduler + ) + ) private def getMptForBlock(block: Block) = { bl.getWorldStateProxy( @@ -338,7 +366,7 @@ object FastSyncItSpec { peerManager ! PeerManagerActor.StartConnecting server ! ServerActor.StartServer(listenAddress) } - _ <- retryUntilWithDelay(Task(nodeStatusHolder.get()), 1.second, 5) {status => + _ <- retryUntilWithDelay(Task(nodeStatusHolder.get()), 1.second, 5) { status => status.serverStatus == Listening(listenAddress) } } yield () @@ -356,7 +384,8 @@ object FastSyncItSpec { _ <- Task { peerManager ! DiscoveredNodesInfo(nodes) } - _ <- retryUntilWithDelay(Task(storagesInstance.storages.knownNodesStorage.getKnownNodes()), 1.second, 5){ knownNodes => + _ <- retryUntilWithDelay(Task(storagesInstance.storages.knownNodesStorage.getKnownNodes()), 1.second, 5) { + knownNodes => val requestedNodes = nodes.map(_.node.id) val currentNodes = knownNodes.map(Node.fromUri).map(_.id) requestedNodes.subsetOf(currentNodes) @@ -364,16 +393,21 @@ object FastSyncItSpec { } yield () } - private def createChildBlock(parent: Block, parentTd: BigInt, parentWorld: InMemoryWorldStateProxy) - (updateWorldForBlock: (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy): (Block, BigInt, InMemoryWorldStateProxy) = { + private def createChildBlock(parent: Block, parentTd: BigInt, parentWorld: InMemoryWorldStateProxy)( + updateWorldForBlock: (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy + ): (Block, BigInt, InMemoryWorldStateProxy) = { val newBlockNumber = parent.header.number + 1 val newWorld = updateWorldForBlock(newBlockNumber, parentWorld) - val newBlock = parent.copy(header = parent.header.copy(parentHash = parent.header.hash, number = newBlockNumber, stateRoot = newWorld.stateRootHash)) + val newBlock = parent.copy(header = + parent.header.copy(parentHash = parent.header.hash, number = newBlockNumber, stateRoot = newWorld.stateRootHash) + ) val newTd = newBlock.header.difficulty + parentTd (newBlock, newTd, parentWorld) } - def importBlocksUntil(n: BigInt)(updateWorldForBlock: (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy): Task[Unit] = { + def importBlocksUntil( + n: BigInt + )(updateWorldForBlock: (BigInt, InMemoryWorldStateProxy) => InMemoryWorldStateProxy): Task[Unit] = { Task(bl.getBestBlock()).flatMap { block => if (block.number >= n) { Task(()) @@ -395,7 +429,7 @@ object FastSyncItSpec { } def waitForFastSyncFinish(): Task[Boolean] = { - retryUntilWithDelay(Task(storagesInstance.storages.appStateStorage.isFastSyncDone()), 1.second, 90){ isDone => + retryUntilWithDelay(Task(storagesInstance.storages.appStateStorage.isFastSyncDone()), 1.second, 90) { isDone => isDone } } @@ -405,7 +439,10 @@ object FastSyncItSpec { Try { val bestBlock = bl.getBestBlock() val bestStateRoot = bestBlock.header.stateRoot - MptTraversals.parseTrieIntoMemory(HashNode(bestStateRoot.toArray), storagesInstance.storages.stateStorage.getBackingStorage(bestBlock.number)) + MptTraversals.parseTrieIntoMemory( + HashNode(bestStateRoot.toArray), + storagesInstance.storages.stateStorage.getBackingStorage(bestBlock.number) + ) }.toOption } } @@ -429,13 +466,15 @@ object FastSyncItSpec { def start2FakePeersRes() = { Resource.make { Task.parZip2(startFakePeer("Peer1"), startFakePeer("Peer2")) - } { case (peer, peer1) => Task.parMap2(peer.shutdown(), peer1.shutdown())((_ ,_)=> ())} + } { case (peer, peer1) => Task.parMap2(peer.shutdown(), peer1.shutdown())((_, _) => ()) } } def start3FakePeersRes() = { Resource.make { - Task.parZip3( startFakePeer("Peer1"), startFakePeer("Peer2"), startFakePeer("Peer3")) - } { case (peer, peer1, peer2) => Task.parMap3(peer.shutdown(), peer1.shutdown(), peer2.shutdown())((_ ,_, _)=> ())} + Task.parZip3(startFakePeer("Peer1"), startFakePeer("Peer2"), startFakePeer("Peer3")) + } { case (peer, peer1, peer2) => + Task.parMap3(peer.shutdown(), peer1.shutdown(), peer2.shutdown())((_, _, _) => ()) + } } } } diff --git a/src/it/scala/io/iohk/ethereum/txExecTest/ContractTest.scala b/src/it/scala/io/iohk/ethereum/txExecTest/ContractTest.scala index 930c67e1e6..1b81b0d4e3 100644 --- a/src/it/scala/io/iohk/ethereum/txExecTest/ContractTest.scala +++ b/src/it/scala/io/iohk/ethereum/txExecTest/ContractTest.scala @@ -6,11 +6,12 @@ import io.iohk.ethereum.domain.Receipt import io.iohk.ethereum.ledger._ import io.iohk.ethereum.txExecTest.util.FixtureProvider import io.iohk.ethereum.utils.Config -import org.scalatest.{ FlatSpec, Matchers } +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.ExecutionContext -class ContractTest extends FlatSpec with Matchers { +class ContractTest extends AnyFlatSpec with Matchers { val blockchainConfig = Config.blockchains.blockchainConfig val syncConfig = Config.SyncConfig(Config.config) val vm = new Ledger.VMImpl diff --git a/src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala b/src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala index 1d501d1855..0b66cac52f 100644 --- a/src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala +++ b/src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala @@ -2,23 +2,22 @@ package io.iohk.ethereum.txExecTest import java.util.concurrent.Executors -import io.iohk.ethereum.domain.{ BlockchainImpl, Receipt, UInt256 } +import io.iohk.ethereum.domain.{BlockchainImpl, Receipt, UInt256} import io.iohk.ethereum.ledger._ import io.iohk.ethereum.txExecTest.util.FixtureProvider -import io.iohk.ethereum.utils.{ BlockchainConfig, MonetaryPolicyConfig } -import org.scalatest.{ FlatSpec, Matchers } +import io.iohk.ethereum.utils.{BlockchainConfig, MonetaryPolicyConfig} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.ExecutionContext -class ECIP1017Test extends FlatSpec with Matchers { +class ECIP1017Test extends AnyFlatSpec with Matchers { val EraDuration = 3 trait TestSetup extends ScenarioSetup { - override lazy val blockchainConfig = BlockchainConfig ( - monetaryPolicyConfig = - MonetaryPolicyConfig(EraDuration, 0.2, 5000000000000000000L, 3000000000000000000L), - + override lazy val blockchainConfig = BlockchainConfig( + monetaryPolicyConfig = MonetaryPolicyConfig(EraDuration, 0.2, 5000000000000000000L, 3000000000000000000L), // unused maxCodeSize = None, chainId = 0x3d.toByte, @@ -41,7 +40,6 @@ class ECIP1017Test extends FlatSpec with Matchers { bootstrapNodes = Set(), accountStartNonce = UInt256.Zero, ethCompatibleStorage = true, - gasTieBreaker = false, atlantisBlockNumber = Long.MaxValue, aghartaBlockNumber = Long.MaxValue, diff --git a/src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala b/src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala index bd2a97a938..cded37e99a 100644 --- a/src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala +++ b/src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala @@ -2,19 +2,20 @@ package io.iohk.ethereum.txExecTest import java.util.concurrent.Executors -import io.iohk.ethereum.domain.{ BlockchainImpl, Receipt, UInt256 } -import io.iohk.ethereum.ledger.{ BlockExecution, BlockQueue, BlockValidation } +import io.iohk.ethereum.domain.{BlockchainImpl, Receipt, UInt256} +import io.iohk.ethereum.ledger.{BlockExecution, BlockQueue, BlockValidation} import io.iohk.ethereum.txExecTest.util.FixtureProvider -import io.iohk.ethereum.utils.{ BlockchainConfig, MonetaryPolicyConfig } -import org.scalatest.{ FlatSpec, Matchers } +import io.iohk.ethereum.utils.{BlockchainConfig, MonetaryPolicyConfig} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.ExecutionContext // scalastyle:off magic.number -class ForksTest extends FlatSpec with Matchers { +class ForksTest extends AnyFlatSpec with Matchers { trait TestSetup extends ScenarioSetup { - override lazy val blockchainConfig = BlockchainConfig ( + override lazy val blockchainConfig = BlockchainConfig( frontierBlockNumber = 0, homesteadBlockNumber = 3, eip150BlockNumber = 5, @@ -23,7 +24,6 @@ class ForksTest extends FlatSpec with Matchers { eip106BlockNumber = Long.MaxValue, chainId = 0x3d.toByte, monetaryPolicyConfig = MonetaryPolicyConfig(5000000, 0.2, 5000000000000000000L, 3000000000000000000L), - // unused bootstrapNodes = Set(), networkId = 1, diff --git a/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala b/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala index ecada4506f..6a87eff4af 100644 --- a/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala +++ b/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala @@ -12,7 +12,6 @@ import io.iohk.ethereum.rlp import io.iohk.ethereum.rpcTest.Tags.{MainNet, PrivNet, PrivNetNoMining} import io.iohk.ethereum.utils.{KeyStoreConfig, Logger} import org.bouncycastle.util.encoders.Hex -import org.scalatest.{FlatSpec, Matchers} import org.web3j.protocol.admin.Admin import org.web3j.protocol.core.DefaultBlockParameter import org.web3j.protocol.core.methods.request.{EthFilter, Transaction} @@ -22,34 +21,36 @@ import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.S import org.web3j.protocol.core.methods.response.EthLog.{Hash, LogObject} import io.iohk.ethereum.rpcTest.TestContracts._ import io.iohk.ethereum.rpcTest.TestData._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.web3j.protocol.core.methods.response.EthLog import scala.collection.JavaConverters._ import scala.language.implicitConversions -class RpcApiTests extends FlatSpec with Matchers with Logger { +class RpcApiTests extends AnyFlatSpec with Matchers with Logger { - "Json rpc service" should "be listening before all tests" taggedAs(MainNet, PrivNet) in new ScenarioSetup { + "Json rpc service" should "be listening before all tests" taggedAs (MainNet, PrivNet) in new ScenarioSetup { val response = service.netListening().send() response.isListening shouldBe true } - it should "return correct protocol version" taggedAs(MainNet, PrivNet) in new ScenarioSetup { + it should "return correct protocol version" taggedAs (MainNet, PrivNet) in new ScenarioSetup { val response = service.ethProtocolVersion().send() hexToBigInt(response.getProtocolVersion) shouldEqual protocolVersion } - it should "return correct client version" taggedAs(MainNet, PrivNet) in new ScenarioSetup { + it should "return correct client version" taggedAs (MainNet, PrivNet) in new ScenarioSetup { val response = service.web3ClientVersion().send() response.getWeb3ClientVersion shouldEqual clientVersion } - it should "correctly calculate Sha3" taggedAs(MainNet, PrivNet) in new ScenarioSetup { + it should "correctly calculate Sha3" taggedAs (MainNet, PrivNet) in new ScenarioSetup { val response = service.web3Sha3("").send() response.getResult shouldEqual "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" } - it should "eth_getBlockTransactionCountByHash" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getBlockTransactionCountByHash" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetBlockTransactionCountByHash(noTransactionsOrUnclesBlock.hash).send() response.getTransactionCount.asBigInt shouldEqual noTransactionsOrUnclesBlock.transactions.size @@ -60,7 +61,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response2.getResult shouldBe null } - it should "eth_getBlockTransactionCountByNumber" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getBlockTransactionCountByNumber" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetBlockTransactionCountByNumber(noTransactionsOrUnclesBlock.blockNumber).send() response.getTransactionCount.asBigInt shouldEqual noTransactionsOrUnclesBlock.transactions.size @@ -72,7 +73,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response2.getError.getCode shouldEqual generalErrorCode } - it should "eth_getUncleCountByBlockHash" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getUncleCountByBlockHash" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetUncleCountByBlockHash(noTransactionsOrUnclesBlock.hash).send() response.getUncleCount.asBigInt shouldEqual noTransactionsOrUnclesBlock.uncles.size @@ -84,7 +85,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response2.getError.getCode shouldEqual generalErrorCode } - it should "eth_getUncleCountByBlockNumber" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getUncleCountByBlockNumber" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetUncleCountByBlockNumber(noTransactionsOrUnclesBlock.blockNumber).send() response.getUncleCount.asBigInt shouldEqual noTransactionsOrUnclesBlock.uncles.size @@ -96,7 +97,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response2.getError.getCode shouldEqual generalErrorCode } - it should "eth_getBlockByHash" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getBlockByHash" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetBlockByHash(twoTransactionBlock.hash, false).send() response.getBlock.getNumber.asBigInt shouldEqual twoTransactionBlock.number @@ -109,8 +110,10 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response2.getError.getCode shouldEqual generalErrorCode } - it should "eth_getTransactionByBlockHashAndIndex" taggedAs(MainNet) in new ScenarioSetup { - val response = service.ethGetTransactionByBlockHashAndIndex(twoTransactionBlock.hash, twoTransactionBlock.transactions.head.index).send() + it should "eth_getTransactionByBlockHashAndIndex" taggedAs (MainNet) in new ScenarioSetup { + val response = service + .ethGetTransactionByBlockHashAndIndex(twoTransactionBlock.hash, twoTransactionBlock.transactions.head.index) + .send() response.getTransaction.isPresent shouldBe true response.getTransaction.get().getHash shouldEqual twoTransactionBlock.transactions.head.hash @@ -118,13 +121,20 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response1.getTransaction.isPresent shouldEqual false response1.getError shouldEqual null - val response2 = service.ethGetTransactionByBlockHashAndIndex(twoTransactionBlock.hash, twoTransactionBlock.transactions.size + 1).send() + val response2 = service + .ethGetTransactionByBlockHashAndIndex(twoTransactionBlock.hash, twoTransactionBlock.transactions.size + 1) + .send() response2.getTransaction.isPresent shouldEqual false response2.getError shouldEqual null } - it should "eth_getTransactionByBlockNumberAndIndex" taggedAs(MainNet) in new ScenarioSetup { - val response = service.ethGetTransactionByBlockNumberAndIndex(twoTransactionBlock.blockNumber, twoTransactionBlock.transactions.head.index).send() + it should "eth_getTransactionByBlockNumberAndIndex" taggedAs (MainNet) in new ScenarioSetup { + val response = service + .ethGetTransactionByBlockNumberAndIndex( + twoTransactionBlock.blockNumber, + twoTransactionBlock.transactions.head.index + ) + .send() response.getTransaction.isPresent shouldBe true response.getTransaction.get().getHash shouldEqual twoTransactionBlock.transactions.head.hash @@ -132,25 +142,32 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response1.getTransaction.isPresent shouldEqual false response1.getError shouldEqual null - val response2 = service.ethGetTransactionByBlockNumberAndIndex(twoTransactionBlock.blockNumber, twoTransactionBlock.transactions.size + 1).send() + val response2 = service + .ethGetTransactionByBlockNumberAndIndex( + twoTransactionBlock.blockNumber, + twoTransactionBlock.transactions.size + 1 + ) + .send() response2.getTransaction.isPresent shouldEqual false response2.getError shouldEqual null } - it should "eth_getUncleByBlockHashAndIndex" taggedAs(MainNet) in new ScenarioSetup { - val response = service.ethGetUncleByBlockHashAndIndex(oneUncleTestBlock.hash, oneUncleTestBlock.uncles.head.index).send() - response.getBlock.getHash shouldEqual oneUncleTestBlock.uncles.head.hash + it should "eth_getUncleByBlockHashAndIndex" taggedAs (MainNet) in new ScenarioSetup { + val response = + service.ethGetUncleByBlockHashAndIndex(oneUncleTestBlock.hash, oneUncleTestBlock.uncles.head.index).send() + response.getBlock.getHash shouldEqual oneUncleTestBlock.uncles.head.hash val response1 = service.ethGetUncleByBlockHashAndIndex(unexisitingBlockHash, 0).send() response1.getBlock shouldEqual null response1.getError shouldEqual null - val response2 = service.ethGetUncleByBlockHashAndIndex(oneUncleTestBlock.hash, oneUncleTestBlock.uncles.head.index + 1).send() + val response2 = + service.ethGetUncleByBlockHashAndIndex(oneUncleTestBlock.hash, oneUncleTestBlock.uncles.head.index + 1).send() response2.getBlock shouldEqual null response2.getError shouldEqual null } - it should "eth_getBlockByNumber without mining" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_getBlockByNumber without mining" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethGetBlockByNumber(latestBlock, false).send() val lBlock = response.getBlock lBlock should not equal null @@ -162,30 +179,34 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { pBlock.getNumber compareTo lBlock.getNumber should be <= 0 } - it should "eth_getUncleByBlockNumberAndIndex" taggedAs(MainNet) in new ScenarioSetup { - val response = service.ethGetUncleByBlockNumberAndIndex(oneUncleTestBlock.blockNumber, oneUncleTestBlock.uncles.head.index).send() - response.getBlock.getHash shouldEqual oneUncleTestBlock.uncles.head.hash + it should "eth_getUncleByBlockNumberAndIndex" taggedAs (MainNet) in new ScenarioSetup { + val response = service + .ethGetUncleByBlockNumberAndIndex(oneUncleTestBlock.blockNumber, oneUncleTestBlock.uncles.head.index) + .send() + response.getBlock.getHash shouldEqual oneUncleTestBlock.uncles.head.hash val response1 = service.ethGetUncleByBlockNumberAndIndex(futureBlock, 0).send() response1.getBlock shouldEqual null response1.getError shouldEqual null - val response2 = service.ethGetUncleByBlockNumberAndIndex(oneUncleTestBlock.blockNumber, oneUncleTestBlock.uncles.head.index + 1).send() + val response2 = service + .ethGetUncleByBlockNumberAndIndex(oneUncleTestBlock.blockNumber, oneUncleTestBlock.uncles.head.index + 1) + .send() response2.getBlock shouldEqual null response2.getError shouldEqual null } - it should "eth_mining false on MainNet" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_mining false on MainNet" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethMining().send() response.isMining shouldEqual false } - it should "eth_hashrate equal to 0 on MainNet" taggedAs(MainNet) in new ScenarioSetup { + it should "eth_hashrate equal to 0 on MainNet" taggedAs (MainNet) in new ScenarioSetup { val response = service.ethHashrate().send() response.getHashrate.asBigInt shouldEqual 0 } - it should "eth_getBalance" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getBalance" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethGetBalance(thirdAccount.address, latestBlock).send() response.getBalance.asBigInt shouldEqual thirdAccount.balance @@ -193,7 +214,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response1.getBalance.asBigInt shouldEqual 0 } - it should "eth_BlockNumber" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_BlockNumber" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethBlockNumber().send() response.getBlockNumber should not equal null val receivedNumber = response.getBlockNumber.asBigInt @@ -206,27 +227,27 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response1.getBlockNumber.asBigInt should be > receivedNumber } - it should "eth_mining true on privNet" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_mining true on privNet" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethMining().send() response.isMining shouldEqual true } - it should "eth_coinbase on privNet" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_coinbase on privNet" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethCoinbase().send() response.getAddress shouldEqual coinbase } - it should "eth_hashrate larger than 0 on privNet" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_hashrate larger than 0 on privNet" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethHashrate().send() response.getHashrate.asBigInt should not equal 0 } - it should "personal_unlockAccount for indefinite duration" taggedAs(PrivNet) in new ScenarioSetup { + it should "personal_unlockAccount for indefinite duration" taggedAs (PrivNet) in new ScenarioSetup { val response = service.personalUnlockAccount(firstAccount.address, firstAccount.password, BigInt(0)).send() response.accountUnlocked() shouldEqual true } - it should "eth_getBlockByNumber with mining" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getBlockByNumber with mining" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethGetBlockByNumber(latestBlock, false).send() val lBlock = response.getBlock lBlock should not equal null @@ -270,12 +291,13 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response7.getBlock shouldEqual null } - it should "eth_getTransactionCount with mining" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getTransactionCount with mining" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() val currentCount = response.getTransactionCount.asBigInt val transferAmount = 100 - val response1 = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() + val response1 = + service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() response1.getError shouldEqual null val minedTransactions = service.transactionObservable().toBlocking.first() @@ -291,7 +313,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { currentCount3 shouldEqual 0 } - it should "not send eth_sendTransaction from locked account" taggedAs(PrivNet) in new ScenarioSetup { + it should "not send eth_sendTransaction from locked account" taggedAs (PrivNet) in new ScenarioSetup { val response1 = service.ethSendTransaction(createContract(thirdAccount.address, testContract)).send() response1.getTransactionHash shouldEqual null @@ -299,12 +321,13 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response1.getError.getMessage shouldEqual "account is locked or unknown" } - it should "eth_sendTransaction for value transfer" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_sendTransaction for value transfer" taggedAs (PrivNet) in new ScenarioSetup { val transferAmaunt = 100 val firstAccountstartBalance = service.ethGetBalance(firstAccount.address, latestBlock).send().getBalance.asBigInt val secondAccountstartBalance = service.ethGetBalance(secondAccount.address, latestBlock).send().getBalance.asBigInt - val response1 = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmaunt)).send() + val response1 = + service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmaunt)).send() response1.getError shouldEqual null val mined = service.transactionObservable().toBlocking.first() @@ -320,63 +343,74 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { secondAccountstartBalance + transferAmaunt shouldEqual secondAccountEndBalance } - it should "eth_sendTransaction with several transactions in pool with same nonce" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_sendTransaction with several transactions in pool with same nonce" taggedAs (PrivNet) in new ScenarioSetup { val fundingAmount = 20000000000000000L val amount1 = 100 val amount2 = 200 val amount3 = 300 - val response = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() - val txCount =response.getTransactionCount.asBigInt + val response = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() + val txCount = response.getTransactionCount.asBigInt - val transfer = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, amount1, Some(txCount))).send() + val transfer = service + .ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, amount1, Some(txCount))) + .send() transfer.getError shouldEqual null - val transfer1 = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, amount2, Some(txCount))).send() + val transfer1 = service + .ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, amount2, Some(txCount))) + .send() transfer1.getError shouldEqual null val mined = service.transactionObservable().toBlocking.first() mined.getValue.asBigInt shouldEqual amount2 - val response2 = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() + val response2 = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() response2.getTransactionCount.asBigInt shouldEqual txCount + 1 // Transactions from two accounts with same nonce val (firstAcc, secondAcc) = setupTwoNewAccounts(firstAccount.address, fundingAmount) - val transfer3 = service.ethSendTransaction(valueTransfer(firstAcc.address, secondAccount.address, amount1, Some(0))).send() + val transfer3 = + service.ethSendTransaction(valueTransfer(firstAcc.address, secondAccount.address, amount1, Some(0))).send() transfer3.getError shouldEqual null - val transfer4 = service.ethSendTransaction(valueTransfer(secondAcc.address, secondAccount.address, amount2, Some(0))).send() + val transfer4 = + service.ethSendTransaction(valueTransfer(secondAcc.address, secondAccount.address, amount2, Some(0))).send() transfer4.getError shouldEqual null val t4hash = transfer4.getTransactionHash - val transfer5 = service.ethSendTransaction(valueTransfer(firstAcc.address, secondAccount.address, amount3, Some(0))).send() + val transfer5 = + service.ethSendTransaction(valueTransfer(firstAcc.address, secondAccount.address, amount3, Some(0))).send() transfer5.getError shouldEqual null val t5hash = transfer5.getTransactionHash - val mineBlock = service.blockObservable(false) + val mineBlock = service + .blockObservable(false) .filter(block => block.getBlock.getTransactions.size == 2) .toBlocking .first() - val minedhashes = mineBlock.getBlock.getTransactions.asScala.map(result => result.asInstanceOf[TransactionHash].get()).toList + val minedhashes = + mineBlock.getBlock.getTransactions.asScala.map(result => result.asInstanceOf[TransactionHash].get()).toList minedhashes should contain theSameElementsAs List(t4hash, t5hash) } - it should "eth_sendRawTransaction" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_sendRawTransaction" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() val nextNonce = response.getTransactionCount.asBigInt val value = 100 - val rawValueTransaction = prepareRawTx(firstAccount, toAccount = Some(secondAccount), value= Some(value), nonce = nextNonce) + val rawValueTransaction = + prepareRawTx(firstAccount, toAccount = Some(secondAccount), value = Some(value), nonce = nextNonce) val response1 = service.ethSendRawTransaction(rawValueTransaction).send val txHash = response1.getTransactionHash val minedTransaction = service.transactionObservable().toBlocking.first() minedTransaction.getHash shouldEqual txHash - val contractCreation = prepareRawTx(firstAccount, data = Some(ByteString(decode(storageContract))), nonce = nextNonce + 1) + val contractCreation = + prepareRawTx(firstAccount, data = Some(ByteString(decode(storageContract))), nonce = nextNonce + 1) val response2 = service.ethSendRawTransaction(contractCreation).send val txHash1 = response2.getTransactionHash @@ -387,8 +421,10 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val value2 = 300 // two transactions with same nonce, only second will get included in blockchain - val rawValueTransaction1 = prepareRawTx(firstAccount, toAccount = Some(secondAccount), value = Some(value1), nonce = nextNonce + 2) - val rawValueTransaction2 = prepareRawTx(firstAccount, toAccount = Some(secondAccount), value = Some(value2), nonce = nextNonce + 2) + val rawValueTransaction1 = + prepareRawTx(firstAccount, toAccount = Some(secondAccount), value = Some(value1), nonce = nextNonce + 2) + val rawValueTransaction2 = + prepareRawTx(firstAccount, toAccount = Some(secondAccount), value = Some(value2), nonce = nextNonce + 2) val response3 = service.ethSendRawTransaction(rawValueTransaction1).send() response3.getError shouldEqual null @@ -421,16 +457,18 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { transfer5.getError shouldEqual null val t5hash = transfer5.getTransactionHash - val mineBlock = service.blockObservable(false) + val mineBlock = service + .blockObservable(false) .filter(block => block.getBlock.getTransactions.size() == 2) .toBlocking .first() - val minedhashes = mineBlock.getBlock.getTransactions.asScala.map(result => result.asInstanceOf[TransactionHash].get()).toList + val minedhashes = + mineBlock.getBlock.getTransactions.asScala.map(result => result.asInstanceOf[TransactionHash].get()).toList minedhashes should contain theSameElementsAs List(t4hash, t5hash) } - it should "eth_sendTransaction for contract creation" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_sendTransaction for contract creation" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() val latestNonce = response.getTransactionCount @@ -452,7 +490,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { latestNonce2.asBigInt shouldEqual latestNonce.add(1).asBigInt } - it should "eth_getStorageAt and eth_getCode" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getStorageAt and eth_getCode" taggedAs (PrivNet) in new ScenarioSetup { // eth_getStorageAt val response = service.ethSendTransaction(createContract(firstAccount.address, storageContract)).send() response.getTransactionHash should not equal null @@ -490,7 +528,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response8.getCode shouldEqual emptyResponse } - it should "eth_getTransactionByHash" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getTransactionByHash" taggedAs (PrivNet) in new ScenarioSetup { val response1 = service.ethSendTransaction(sampleTransaction).send() response1.getTransactionHash should not equal null val tHash = response1.getTransactionHash @@ -505,7 +543,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response3.getTransaction.isPresent shouldEqual true } - it should "eth_getTransactionReceipt" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_getTransactionReceipt" taggedAs (PrivNet) in new ScenarioSetup { val response1 = service.ethSendTransaction(sampleTransaction).send() response1.getTransactionHash should not equal null val tHash = response1.getTransactionHash @@ -520,7 +558,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response3.getTransaction.isPresent shouldEqual true } - it should "eth_Call" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_Call" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethCall(valueTransfer(firstAccount.address, secondAccount.address, 100), latestBlock).send() response.getValue shouldEqual emptyResponse @@ -533,29 +571,45 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { response3.getTransactionReceipt.isPresent shouldBe true val receipt = response3.getTransactionReceipt.get() - val response4 = service.ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), latestBlock).send() + val response4 = service + .ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), latestBlock) + .send() hexToBigInt(response4.getValue) shouldEqual 0 - val response5 = service.ethSendTransaction(contractCall(firstAccount.address, receipt.getContractAddress, writeContract(1, incrementEventContract))).send() + val response5 = service + .ethSendTransaction( + contractCall(firstAccount.address, receipt.getContractAddress, writeContract(1, incrementEventContract)) + ) + .send() val minedTransaction1 = service.transactionObservable().toBlocking.first() - val response6 = service.ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), latestBlock).send() + val response6 = service + .ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), latestBlock) + .send() hexToBigInt(response6.getValue) shouldEqual 1 - val response7 = service.ethSendTransaction(contractCall(firstAccount.address, receipt.getContractAddress, writeContract(2, incrementEventContract))).send() + val response7 = service + .ethSendTransaction( + contractCall(firstAccount.address, receipt.getContractAddress, writeContract(2, incrementEventContract)) + ) + .send() response7.getError shouldEqual null val minedTransaction2 = service.transactionObservable().toBlocking.first() - val response8 = service.ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), pendingBlock).send() + val response8 = service + .ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract), pendingBlock) + .send() hexToBigInt(response8.getValue) shouldEqual 2 - val response9 = service.ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract, Some(10)), latestBlock).send() + val response9 = service + .ethCall(contractCall(firstAccount.address, receipt.getContractAddress, readEventContract, Some(10)), latestBlock) + .send() response9.getValue shouldEqual emptyResponse } - it should "eth_estimateGas" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_estimateGas" taggedAs (PrivNet) in new ScenarioSetup { val response = service.ethEstimateGas(valueTransfer(firstAccount.address, secondAccount.address, 100)).send() response.getAmountUsed.asBigInt shouldEqual 21000 @@ -563,7 +617,9 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { // defaults to highest possible value (block gas limit) but according to spreadsheet should default to 0 // It is worth investigating - EC536 val blockResponse = service.ethGetBlockByNumber(latestBlock, false).send() - val response6 = service.ethEstimateGas(valueTransfer(firstAccount.address, secondAccount.address, firstAccount.balance + 500)).send() + val response6 = service + .ethEstimateGas(valueTransfer(firstAccount.address, secondAccount.address, firstAccount.balance + 500)) + .send() response6.getAmountUsed.asBigInt shouldEqual blockResponse.getBlock.getGasLimit.asBigInt val response1 = service.ethEstimateGas(createContract(firstAccount.address, testContract)).send() @@ -579,7 +635,9 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { receipt.getGasUsed.asBigInt shouldEqual gasEstimated - val response4 = service.ethSendTransaction(createContract(firstAccount.address, testContract, Some((gasEstimated - 1).bigInteger))).send() + val response4 = service + .ethSendTransaction(createContract(firstAccount.address, testContract, Some((gasEstimated - 1).bigInteger))) + .send() val txHash1 = response4.getTransactionHash val minedTransaction1 = service.transactionObservable().toBlocking.first() @@ -588,11 +646,13 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val receipt1 = response5.getTransactionReceipt.get() } - it should "eth_getLogs" taggedAs(PrivNet) in new ScenarioSetup { - val setupContractResponse = service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() + it should "eth_getLogs" taggedAs (PrivNet) in new ScenarioSetup { + val setupContractResponse = + service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() setupContractResponse.getError shouldEqual null - val setupContractResponse1 = service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() + val setupContractResponse1 = + service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() setupContractResponse1.getError shouldEqual null // Mine 2 Contract creation transactions @@ -610,25 +670,44 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val updateValue = 5 val emitValue = 10 // Call contracts which emits logs - val counterResponse = service.ethSendTransaction(contractCall(firstAccount.address, receipt.getContractAddress, writeContract(updateValue, incrementEventContract))).send() - val emiterResponse = service.ethSendTransaction(contractCall(firstAccount.address, receipt2.getContractAddress, writeContract(emitValue, emitEvent))).send() + val counterResponse = service + .ethSendTransaction( + contractCall( + firstAccount.address, + receipt.getContractAddress, + writeContract(updateValue, incrementEventContract) + ) + ) + .send() + val emiterResponse = service + .ethSendTransaction( + contractCall(firstAccount.address, receipt2.getContractAddress, writeContract(emitValue, emitEvent)) + ) + .send() val minedBlock1 = service.blockObservable(false).toBlocking.first() // All filter which maps to test cases // Used simple log filter that includes all txs, expected all txs logs to be shown - val filter = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val filter = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) // Used log filter with higher fromBlock than toBlock, expected no change to be included val badFilter = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber.add(1)), getBlockParam(minedBlock1.getBlock.getNumber.subtract(1)), List(firstAccount.address).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber.add(1)), + getBlockParam(minedBlock1.getBlock.getNumber.subtract(1)), + List(firstAccount.address).asJava + ) // Used log filter that filters by event, expected only events selected to be shown - val particularEventTopic = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val particularEventTopic = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) particularEventTopic.addSingleTopic(counterContractEventHash) // Used log filter with topic length larger than logs, expected no change to be included - val toLongTopic = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val toLongTopic = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) toLongTopic .addSingleTopic(counterContractEventHash) .addSingleTopic(createTopic(firstAccount.address.drop(2))) @@ -637,11 +716,19 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { // Used log filter incluiding various contracts, expected changes from all contracts val variousContracts = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(receipt.getContractAddress, receipt2.getContractAddress).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber), + latestBlock, + List(receipt.getContractAddress, receipt2.getContractAddress).asJava + ) // Used log filter including only a null topic, expected changes to include all events val nullTopic = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(receipt.getContractAddress, receipt2.getContractAddress).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber), + latestBlock, + List(receipt.getContractAddress, receipt2.getContractAddress).asJava + ) nullTopic.addNullTopic() val response = service.ethGetLogs(filter).send() @@ -669,28 +756,30 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { nullTopicLogs.size shouldEqual 2 } - it should "net_peerCount on privnet" taggedAs(PrivNet) in new ScenarioSetup { - val response = service.netPeerCount().send() + it should "net_peerCount on privnet" taggedAs (PrivNet) in new ScenarioSetup { + val response = service.netPeerCount().send() response.getQuantity.asBigInt shouldEqual 0 } - it should "eth_syncing on privnet" taggedAs(PrivNet, PrivNetNoMining) in new ScenarioSetup { - val response = service.ethSyncing().send() + it should "eth_syncing on privnet" taggedAs (PrivNet, PrivNetNoMining) in new ScenarioSetup { + val response = service.ethSyncing().send() response.isSyncing shouldEqual false } // test case really similar to eth_Logs but now filters are installed via id - it should "eth_newFilter and eth_getFilterLogs" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_newFilter and eth_getFilterLogs" taggedAs (PrivNet) in new ScenarioSetup { val blockFilter = service.ethNewBlockFilter().send() val blockFilterId = blockFilter.getFilterId val pendingTransactionFilter = service.ethNewPendingTransactionFilter().send() val pendingTransactionFilterId = pendingTransactionFilter.getFilterId - val setupContractResponse = service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() + val setupContractResponse = + service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() setupContractResponse.getError shouldEqual null - val setupContractResponse1 = service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() + val setupContractResponse1 = + service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() setupContractResponse1.getError shouldEqual null // Mine 2 Contract creation transactions @@ -708,8 +797,20 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val updateValue = 5 val emitValue = 10 // Call contracts which emits logs - val counterResponse = service.ethSendTransaction(contractCall(firstAccount.address, receipt.getContractAddress, writeContract(updateValue, incrementEventContract))).send() - val emiterResponse = service.ethSendTransaction(contractCall(firstAccount.address, receipt2.getContractAddress, writeContract(emitValue, emitEvent))).send() + val counterResponse = service + .ethSendTransaction( + contractCall( + firstAccount.address, + receipt.getContractAddress, + writeContract(updateValue, incrementEventContract) + ) + ) + .send() + val emiterResponse = service + .ethSendTransaction( + contractCall(firstAccount.address, receipt2.getContractAddress, writeContract(emitValue, emitEvent)) + ) + .send() val pendingTransactionLogs = service.ethGetFilterLogs(pendingTransactionFilterId).send() pendingTransactionLogs.getLogs.asScala.size shouldEqual 2 @@ -718,18 +819,25 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { // All filter which maps to test cases // Used simple log filter that includes all txs, expected all txs logs to be shown - val filter = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val filter = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) // Used log filter with higher fromBlock than toBlock, expected no change to be included val badFilter = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber.add(1)), getBlockParam(minedBlock1.getBlock.getNumber.subtract(1)), List(firstAccount.address).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber.add(1)), + getBlockParam(minedBlock1.getBlock.getNumber.subtract(1)), + List(firstAccount.address).asJava + ) // Used log filter that filters by event, expected only events selected to be shown - val particularEventTopic = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val particularEventTopic = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) particularEventTopic.addSingleTopic(counterContractEventHash) // Used log filter with topic length larger than logs, expected no change to be included - val toLongTopic = new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) + val toLongTopic = + new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(firstAccount.address).asJava) toLongTopic .addSingleTopic(counterContractEventHash) .addSingleTopic(createTopic(firstAccount.address.drop(2))) @@ -738,11 +846,19 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { // Used log filter incluiding various contracts, expected changes from all contracts val variousContracts = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(receipt.getContractAddress, receipt2.getContractAddress).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber), + latestBlock, + List(receipt.getContractAddress, receipt2.getContractAddress).asJava + ) // Used log filter including only a null topic, expected changes to include all events val nullTopic = - new EthFilter(getBlockParam(minedBlock1.getBlock.getNumber), latestBlock, List(receipt.getContractAddress, receipt2.getContractAddress).asJava) + new EthFilter( + getBlockParam(minedBlock1.getBlock.getNumber), + latestBlock, + List(receipt.getContractAddress, receipt2.getContractAddress).asJava + ) nullTopic.addNullTopic() // Install All filters @@ -785,7 +901,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { nonExistingFilterChanges.getLogs.asScala.size shouldEqual 0 } - it should "eth_newBlockFilter" taggedAs(PrivNet, MainNet) in new ScenarioSetup { + it should "eth_newBlockFilter" taggedAs (PrivNet, MainNet) in new ScenarioSetup { val blockFilter = service.ethNewBlockFilter().send() val filterid = blockFilter.getFilterId @@ -795,26 +911,31 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val logs = changes.getLogs.asScala.toList val addedBlocks = logs.map(log => log.asInstanceOf[Hash].get) - addedBlocks should contain (minedBlock.getBlock.getHash) + addedBlocks should contain(minedBlock.getBlock.getHash) } - it should "eth_newPendingTransactionFilter" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_newPendingTransactionFilter" taggedAs (PrivNet) in new ScenarioSetup { val transactionFilter = service.ethNewPendingTransactionFilter().send() val filterid = transactionFilter.getFilterId - val setupContractResponse = service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() + val setupContractResponse = + service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() setupContractResponse.getError shouldEqual null - val setupContractResponse1 = service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() + val setupContractResponse1 = + service.ethSendTransaction(createContract(firstAccount.address, emitEventContract)).send() setupContractResponse1.getError shouldEqual null val changes = service.ethGetFilterChanges(filterid).send() val pendingTransactions = changes.getLogs.asScala.toList.map(log => log.asInstanceOf[Hash].get) - pendingTransactions should contain theSameElementsAs List(setupContractResponse.getTransactionHash, setupContractResponse1.getTransactionHash) + pendingTransactions should contain theSameElementsAs List( + setupContractResponse.getTransactionHash, + setupContractResponse1.getTransactionHash + ) } - it should "eth_uninstallFilter" taggedAs(PrivNet) in new ScenarioSetup { + it should "eth_uninstallFilter" taggedAs (PrivNet) in new ScenarioSetup { val filter = new EthFilter(earliestBlock, latestBlock, List(firstAccount.address).asJava) val txFilter = service.ethNewFilter(filter).send() val logFilter = txFilter.getFilterId @@ -829,20 +950,21 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { // Uninstall block filter val blockFilter = service.ethNewBlockFilter().send() val blockFilterid = blockFilter.getFilterId - val minedBlock =service.blockObservable(false).toBlocking.first() + val minedBlock = service.blockObservable(false).toBlocking.first() val blockchanges = service.ethGetFilterChanges(blockFilterid).send() val addedBlocks = blockchanges.getLogs.asScala.toList.map(log => log.asInstanceOf[Hash].get) - addedBlocks should contain (minedBlock.getBlock.getHash) + addedBlocks should contain(minedBlock.getBlock.getHash) val uninstalTxFilterResponse3 = service.ethUninstallFilter(blockFilterid).send() uninstalTxFilterResponse.isUninstalled shouldEqual true - val minedBlock1 =service.blockObservable(false).toBlocking.first() + val minedBlock1 = service.blockObservable(false).toBlocking.first() val blockchanges1 = service.ethGetFilterChanges(blockFilterid).send() blockchanges1.getLogs.asScala.toList.size shouldEqual 0 // Uninstall pending filter val transactionFilter = service.ethNewPendingTransactionFilter().send() val transactionFilterId = transactionFilter.getFilterId - val setupContractResponse = service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() + val setupContractResponse = + service.ethSendTransaction(createContract(firstAccount.address, counterEventContract)).send() setupContractResponse.getError shouldEqual null val changes = service.ethGetFilterChanges(transactionFilterId).send() val pendingTransactions = changes.getLogs.asScala.toList.map(log => log.asInstanceOf[Hash].get) @@ -861,8 +983,16 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val updateValue = 5 // Call contracts which emits logs - val counterResponse = service.ethSendTransaction(contractCall(firstAccount.address, receipt.getContractAddress, writeContract(updateValue, incrementEventContract))).send() - val minedBlock3= service.blockObservable(false).toBlocking.first() + val counterResponse = service + .ethSendTransaction( + contractCall( + firstAccount.address, + receipt.getContractAddress, + writeContract(updateValue, incrementEventContract) + ) + ) + .send() + val minedBlock3 = service.blockObservable(false).toBlocking.first() // log filter was uninstalled val logsResponse = service.ethGetFilterChanges(logFilter).send() @@ -870,7 +1000,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { logs.size shouldEqual 0 } - it should "eth_getWork and eth_submitWork" taggedAs(PrivNetNoMining) in new ScenarioSetup { + it should "eth_getWork and eth_submitWork" taggedAs (PrivNetNoMining) in new ScenarioSetup { val currentBlock = service.ethGetBlockByNumber(latestBlock, false).send().getBlock val workResponse = service.ethGetWork().send() val pendingBlockR = service.ethGetBlockByNumber(pendingBlock, false).send().getBlock @@ -884,7 +1014,8 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { workResponse.getCurrentBlockHeaderPowHash should not equal workResponse1.getCurrentBlockHeaderPowHash pendingBlockR.getTimestamp.asBigInt should not equal pendingBlockR1.getTimestamp.asBigInt - val submitResponse = service.ethSubmitWork(currentBlock.getNonceRaw, currentBlock.getHash, currentBlock.getHash).send() + val submitResponse = + service.ethSubmitWork(currentBlock.getNonceRaw, currentBlock.getHash, currentBlock.getHash).send() submitResponse.solutionValid() shouldEqual false val fakeNonce = "0x1233452345" @@ -895,10 +1026,10 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { submitResponse1.solutionValid() shouldEqual false } - it should "eth_submitHashRate" taggedAs(PrivNetNoMining) in new ScenarioSetup { + it should "eth_submitHashRate" taggedAs (PrivNetNoMining) in new ScenarioSetup { val hashRate1 = "0x0000000000000000000000000000000000000000000000000000000000500000" val hashRate2 = "0x0000000000000000000000000000000000000000000000000000000000600000" - val id = "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" + val id = "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" val id2 = "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283d" val hashRateResponse = service.ethSubmitHashrate(hashRate1, id).send() @@ -925,7 +1056,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { getHashRateResponse3.getHashrate.asBigInt shouldEqual 0 } - it should "eth_getTransactionCount without mining" taggedAs(PrivNetNoMining) in new ScenarioSetup { + it should "eth_getTransactionCount without mining" taggedAs (PrivNetNoMining) in new ScenarioSetup { val unlockAccountResponse = service.personalUnlockAccount(firstAccount.address, firstAccount.password, 0).send() unlockAccountResponse.accountUnlocked() shouldEqual true @@ -933,7 +1064,8 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { val currentCount = curentCountResponse.getTransactionCount val transferAmount = 100 - val response1 = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() + val response1 = + service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() response1.getError shouldEqual null val curentCountResponse1 = service.ethGetTransactionCount(firstAccount.address, pendingBlock).send() @@ -942,7 +1074,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { currentCount.asBigInt shouldEqual currentCount1.asBigInt } - it should "personal_ListAccounts and eth_ListAccounts " taggedAs(PrivNet) in new ScenarioSetup { + it should "personal_ListAccounts and eth_ListAccounts " taggedAs (PrivNet) in new ScenarioSetup { val response = service.personalListAccounts().send() val personalAccounts = response.getAccountIds.asScala @@ -955,7 +1087,7 @@ class RpcApiTests extends FlatSpec with Matchers with Logger { } // There is no api to delete account, so to avoid creating a lot of unnecessery key stores several methods in one test - it should "personal_newAccount and personal_unlockAccount and personal_sendTransaction" taggedAs(PrivNet) in new ScenarioSetup { + it should "personal_newAccount and personal_unlockAccount and personal_sendTransaction" taggedAs (PrivNet) in new ScenarioSetup { val acc1Pass = "1234567" val response = service.personalNewAccount(acc1Pass).send() val newAccId = response.getAccountId @@ -1044,7 +1176,7 @@ abstract class ScenarioSetup { // Helpers to provide some meaningful naming in tests def createContract(address: String, code: String, gasLimit: Option[BigInteger] = None): Transaction = { - new Transaction ( + new Transaction( address, null, null, @@ -1056,7 +1188,7 @@ abstract class ScenarioSetup { } def contractCall(address: String, to: String, data: String, gasLimit: Option[BigInteger] = None): Transaction = { - new Transaction ( + new Transaction( address, null, null, @@ -1067,8 +1199,14 @@ abstract class ScenarioSetup { ) } - def valueTransfer(from: String, to: String, amount: BigInt, nonce: Option[BigInteger] = None, gasLimit: Option[BigInteger] = None): Transaction = { - new Transaction ( + def valueTransfer( + from: String, + to: String, + amount: BigInt, + nonce: Option[BigInteger] = None, + gasLimit: Option[BigInteger] = None + ): Transaction = { + new Transaction( from, nonce.orNull, null, @@ -1111,11 +1249,12 @@ abstract class ScenarioSetup { } def prepareRawTx( - fromAccount: TestAccount, - toAccount: Option[TestAccount] = None, - value: Option[BigInt] = None, - data: Option[ByteString] = None, - nonce: BigInt): String = { + fromAccount: TestAccount, + toAccount: Option[TestAccount] = None, + value: Option[BigInt] = None, + data: Option[ByteString] = None, + nonce: BigInt + ): String = { val fromAddress = Address(fromAccount.address) val fromWallet = getAccountWallet(fromAccount.address, fromAccount.password) @@ -1124,7 +1263,8 @@ abstract class ScenarioSetup { to = toAccount.map(acc => Address(acc.address)), value = value, data = data, - nonce = Some(nonce)) + nonce = Some(nonce) + ) val transaction = req.toTransaction(0) diff --git a/src/snappy/scala/io/iohk/ethereum/snappy/SnappyTest.scala b/src/snappy/scala/io/iohk/ethereum/snappy/SnappyTest.scala index 2d2039153d..6b1f720ad4 100644 --- a/src/snappy/scala/io/iohk/ethereum/snappy/SnappyTest.scala +++ b/src/snappy/scala/io/iohk/ethereum/snappy/SnappyTest.scala @@ -1,13 +1,14 @@ package io.iohk.ethereum.snappy -import io.iohk.ethereum.domain.{ Block, Receipt } -import io.iohk.ethereum.ledger.{ BlockExecution, BlockQueue, BlockValidation } +import io.iohk.ethereum.domain.{Block, Receipt} +import io.iohk.ethereum.ledger.{BlockExecution, BlockQueue, BlockValidation} import io.iohk.ethereum.utils.Logger -import org.scalatest.{ FreeSpec, Matchers } +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ -class SnappyTest extends FreeSpec with Matchers with Logger { +class SnappyTest extends AnyFreeSpec with Matchers with Logger { val config = Config() val pre = new Prerequisites(config) @@ -26,10 +27,12 @@ class SnappyTest extends FreeSpec with Matchers with Logger { progLog.start() for (n <- startN to targetN) { - val block: Block = sourceBlockchain.getBlockByNumber(n) + val block: Block = sourceBlockchain + .getBlockByNumber(n) .getOrElse(fail(s"Failed to retrieve block by number: $n")) - val expectedReceipts = sourceBlockchain.getReceiptsByHash(block.header.hash) + val expectedReceipts = sourceBlockchain + .getReceiptsByHash(block.header.hash) .getOrElse(fail(s"Failed to retrieve receipts for block number: $n")) val result = executeBlock(block) @@ -41,7 +44,8 @@ class SnappyTest extends FreeSpec with Matchers with Logger { case Right(receipts) => if (receipts == expectedReceipts) { targetBlockchain.foreach { blockchain => - blockchain.storeBlock(block) + blockchain + .storeBlock(block) .and(blockchain.storeReceipts(block.header.hash, receipts)) .commit() } @@ -58,7 +62,8 @@ class SnappyTest extends FreeSpec with Matchers with Logger { targetBlockchain match { case Some(blockchain) => val blockValidation = new BlockValidation(consensus, blockchain, BlockQueue(blockchain, syncConfig)) - val blockExecution = new BlockExecution(blockchain, blockchainConfig, consensus.blockPreparator, blockValidation) + val blockExecution = + new BlockExecution(blockchain, blockchainConfig, consensus.blockPreparator, blockValidation) blockExecution.executeBlock(block) case None => diff --git a/src/test/scala/io/iohk/ethereum/BootstrapDownloadSpec.scala b/src/test/scala/io/iohk/ethereum/BootstrapDownloadSpec.scala index e1066b9a7d..a126a51b92 100644 --- a/src/test/scala/io/iohk/ethereum/BootstrapDownloadSpec.scala +++ b/src/test/scala/io/iohk/ethereum/BootstrapDownloadSpec.scala @@ -3,11 +3,12 @@ package io.iohk.ethereum import java.io.File import java.nio.file.Paths -import org.scalatest.{FlatSpec, Matchers} import scala.io.Source +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BootstrapDownloadSpec extends FlatSpec with Matchers { +class BootstrapDownloadSpec extends AnyFlatSpec with Matchers { val testURL = getClass.getResource("/downloadtest.zip") // generated by `shasum -a 512` on macOs diff --git a/src/test/scala/io/iohk/ethereum/SpecBase.scala b/src/test/scala/io/iohk/ethereum/SpecBase.scala index eee6a21fc5..c020650799 100644 --- a/src/test/scala/io/iohk/ethereum/SpecBase.scala +++ b/src/test/scala/io/iohk/ethereum/SpecBase.scala @@ -10,8 +10,13 @@ import org.scalatest._ import scala.concurrent.Future import scala.concurrent.ExecutionContext import scala.language.higherKinds +import org.scalatest.diagrams.Diagrams +import org.scalatest.flatspec.AsyncFlatSpecLike +import org.scalatest.freespec.AsyncFreeSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AsyncWordSpecLike -trait SpecBase extends TypeCheckedTripleEquals with DiagrammedAssertions with Matchers { self: AsyncTestSuite => +trait SpecBase extends TypeCheckedTripleEquals with Diagrams with Matchers { self: AsyncTestSuite => override val executionContext = ExecutionContext.global implicit val scheduler: Scheduler = Scheduler(executionContext) diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockBroadcastSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockBroadcastSpec.scala index f8d0d2a4f3..d45e1eb89b 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockBroadcastSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockBroadcastSpec.scala @@ -12,11 +12,12 @@ import io.iohk.ethereum.network.p2p.messages.CommonMessages.{NewBlock, Status} import io.iohk.ethereum.network.p2p.messages.PV62.NewBlockHashes import io.iohk.ethereum.network.p2p.messages.{PV62, Versions} import io.iohk.ethereum.utils.Config -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockBroadcastSpec extends FlatSpec with Matchers { +class BlockBroadcastSpec extends AnyFlatSpec with Matchers { it should "send a new block when it is not known by the peer (known by comparing total difficulties)" in new TestSetup { //given diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockchainHostActorSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockchainHostActorSpec.scala index 95240d3661..05619d54cc 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockchainHostActorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/BlockchainHostActorSpec.scala @@ -15,13 +15,14 @@ import io.iohk.ethereum.network.p2p.messages.PV63.MptNodeEncoders._ import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration import io.iohk.ethereum.network.{EtcPeerManagerActor, PeerId} import io.iohk.ethereum.{Fixtures, Timeouts, crypto} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import scala.concurrent.duration.{FiniteDuration, _} import scala.language.postfixOps +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockchainHostActorSpec extends FlatSpec with Matchers { +class BlockchainHostActorSpec extends AnyFlatSpec with Matchers { it should "return Receipts for block hashes" in new TestSetup { peerEventBus.expectMsg(Subscribe(MessageClassifier( diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/FastSyncStateStorageActorSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/FastSyncStateStorageActorSpec.scala index b7be69109a..d51c31e12b 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/FastSyncStateStorageActorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/FastSyncStateStorageActorSpec.scala @@ -10,7 +10,8 @@ import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.db.storage.FastSyncStateStorage import io.iohk.ethereum.Fixtures import org.scalatest.concurrent.Eventually -import org.scalatest.{AsyncFlatSpec, Matchers} +import org.scalatest.flatspec.AsyncFlatSpec +import org.scalatest.matchers.should.Matchers class FastSyncStateStorageActorSpec extends AsyncFlatSpec with Matchers with Eventually with NormalPatience { diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncControllerSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncControllerSpec.scala index 431480e6ac..42afd40b07 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncControllerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncControllerSpec.scala @@ -25,14 +25,16 @@ import io.iohk.ethereum.network.{EtcPeerManagerActor, Peer} import io.iohk.ethereum.utils.Config.SyncConfig import io.iohk.ethereum.{Fixtures, Mocks} import org.scalamock.scalatest.MockFactory -import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers} +import org.scalatest.BeforeAndAfter import org.bouncycastle.util.encoders.Hex import scala.concurrent.Await import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off file.size.limit -class SyncControllerSpec extends FlatSpec with Matchers with BeforeAndAfter with MockFactory { +class SyncControllerSpec extends AnyFlatSpec with Matchers with BeforeAndAfter with MockFactory { implicit var system: ActorSystem = _ diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncStateSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncStateSpec.scala index 17dbea8dd5..f20db7eb39 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncStateSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/SyncStateSpec.scala @@ -3,9 +3,10 @@ package io.iohk.ethereum.blockchain.sync import akka.util.ByteString import io.iohk.ethereum.Fixtures import io.iohk.ethereum.blockchain.sync.FastSync.{EvmCodeHash, StateMptNodeHash, SyncState} -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class SyncStateSpec extends FlatSpec with Matchers { +class SyncStateSpec extends AnyFlatSpec with Matchers { "SyncState" should "prepend mpt nodes when enqueueing them" in { val syncState = SyncState( diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherStateSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherStateSpec.scala index 69a0e2d5db..af0e953883 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherStateSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherStateSpec.scala @@ -3,11 +3,12 @@ package io.iohk.ethereum.blockchain.sync.regular import akka.actor.ActorSystem import akka.testkit.{TestKit, TestProbe} import io.iohk.ethereum.domain.Block -import org.scalatest.{Matchers, WordSpecLike} import io.iohk.ethereum.Fixtures.Blocks.ValidBlock import io.iohk.ethereum.network.PeerId +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class BlockFetcherStateSpec extends TestKit(ActorSystem()) with WordSpecLike with Matchers { +class BlockFetcherStateSpec extends TestKit(ActorSystem()) with AnyWordSpecLike with Matchers { "BlockFetcherState" when { "invalidating blocks" should { "not allow to go to negative block number" in { diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/OldRegularSyncSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/OldRegularSyncSpec.scala index f8181a030b..17860e3dd2 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/OldRegularSyncSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/OldRegularSyncSpec.scala @@ -29,13 +29,14 @@ import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.Eventually import org.scalatest.time.{Seconds, Span} -import org.scalatest.{Matchers, WordSpec} import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off magic.number -class OldRegularSyncSpec extends WordSpec with Matchers with MockFactory with Eventually { +class OldRegularSyncSpec extends AnyWordSpec with Matchers with MockFactory with Eventually { "Old RegularSync" when { diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncFixtures.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncFixtures.scala index 914cc47a11..e7362d6b34 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncFixtures.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncFixtures.scala @@ -29,13 +29,13 @@ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils.Config.SyncConfig import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.scalamock.scalatest.MockFactory -import org.scalatest.Matchers import scala.collection.mutable import scala.concurrent.duration.FiniteDuration import scala.concurrent.{ExecutionContext, Future} import scala.math.BigInt import scala.reflect.ClassTag +import org.scalatest.matchers.should.Matchers // Fixture classes are wrapped in a trait due to problems with making mocks available inside of them trait RegularSyncFixtures { self: Matchers with MockFactory => diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala index 47b6eff313..da4c1a5292 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala @@ -22,12 +22,14 @@ import io.iohk.ethereum.network.{EtcPeerManagerActor, Peer, PeerEventBusActor} import io.iohk.ethereum.ommers.OmmersPool.RemoveOmmers import io.iohk.ethereum.utils.Config.SyncConfig import org.scalamock.scalatest.MockFactory -import org.scalatest.{BeforeAndAfterEach, Matchers, WordSpecLike} +import org.scalatest.BeforeAndAfterEach import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future, Promise} +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class RegularSyncSpec extends RegularSyncFixtures with WordSpecLike with BeforeAndAfterEach with Matchers with MockFactory { +class RegularSyncSpec extends RegularSyncFixtures with AnyWordSpecLike with BeforeAndAfterEach with Matchers with MockFactory { type Fixture = RegularSyncFixture var testSystem: ActorSystem = _ diff --git a/src/test/scala/io/iohk/ethereum/consensus/BlockGeneratorSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/BlockGeneratorSpec.scala index 692fd1eb42..4affae457f 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/BlockGeneratorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/BlockGeneratorSpec.scala @@ -15,15 +15,16 @@ import io.iohk.ethereum.domain._ import io.iohk.ethereum.ledger.{BlockExecution, BlockPreparationError, BlockQueue, BlockValidation} import io.iohk.ethereum.mpt.MerklePatriciaTrie.MPTException import io.iohk.ethereum.utils._ -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.crypto.params.ECPublicKeyParameters import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.duration.Duration import scala.concurrent.{Await, ExecutionContext} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockGeneratorSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with Logger { +class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with Logger { implicit val testContext = ExecutionContext.fromExecutor(Executors.newFixedThreadPool(4)) "BlockGenerator" should "generate correct block with empty transactions" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/consensus/ConsensusSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/ConsensusSpec.scala index 4c0db5b488..6de4b5698f 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/ConsensusSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/ConsensusSpec.scala @@ -1,8 +1,9 @@ package io.iohk.ethereum.consensus -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ConsensusSpec extends FlatSpec with Matchers { +class ConsensusSpec extends AnyFlatSpec with Matchers { "KnownProtocols" should "have unique names" in { val protocols = Protocol.KnownProtocols diff --git a/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashMinerSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashMinerSpec.scala index c7e0611554..959443f75c 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashMinerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashMinerSpec.scala @@ -14,11 +14,13 @@ import io.iohk.ethereum.ommers.OmmersPool import io.iohk.ethereum.transactions.PendingTransactionsManager import org.bouncycastle.util.encoders.Hex import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpecLike, Matchers, Tag} +import org.scalatest.Tag import scala.concurrent.Future import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpecLike +import org.scalatest.matchers.should.Matchers -class EthashMinerSpec extends TestKit(ActorSystem("EthashMinerSpec_System")) with FlatSpecLike with Matchers { +class EthashMinerSpec extends TestKit(ActorSystem("EthashMinerSpec_System")) with AnyFlatSpecLike with Matchers { final val EthashMinerSpecTag = Tag("EthashMinerSpec") private implicit val timeout: Duration = 10.minutes diff --git a/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashUtilsSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashUtilsSpec.scala index cd363b7857..d383eb5c3a 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashUtilsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/ethash/EthashUtilsSpec.scala @@ -3,11 +3,12 @@ package io.iohk.ethereum.consensus.ethash import akka.util.ByteString import io.iohk.ethereum.crypto.kec256 import org.scalacheck.Arbitrary -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class EthashUtilsSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class EthashUtilsSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { import io.iohk.ethereum.consensus.ethash.EthashUtils._ diff --git a/src/test/scala/io/iohk/ethereum/consensus/ethash/MockedMinerSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/ethash/MockedMinerSpec.scala index cc22281563..e35e129d0a 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/ethash/MockedMinerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/ethash/MockedMinerSpec.scala @@ -9,10 +9,12 @@ import io.iohk.ethereum.utils.ByteStringUtils import org.scalatest._ import scala.concurrent.Future import scala.concurrent.duration._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class MockedMinerSpec extends TestKit(ActorSystem("MockedPowMinerSpec_System")) - with WordSpecLike + with AnyWordSpecLike with Matchers with WithActorSystemShutDown { diff --git a/src/test/scala/io/iohk/ethereum/consensus/validators/BlockHeaderValidatorSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/validators/BlockHeaderValidatorSpec.scala index 5736ecd009..28d6e0414f 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/validators/BlockHeaderValidatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/validators/BlockHeaderValidatorSpec.scala @@ -10,14 +10,15 @@ import io.iohk.ethereum.consensus.validators.BlockHeaderValidator._ import io.iohk.ethereum.domain.{UInt256, _} import io.iohk.ethereum.utils.{BlockchainConfig, DaoForkConfig} import io.iohk.ethereum.{Fixtures, ObjectGenerators} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalamock.scalatest.MockFactory import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number class BlockHeaderValidatorSpec - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators diff --git a/src/test/scala/io/iohk/ethereum/consensus/validators/BlockValidatorSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/validators/BlockValidatorSpec.scala index 8e1ae6f8ac..3909d4ea33 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/validators/BlockValidatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/validators/BlockValidatorSpec.scala @@ -5,10 +5,11 @@ import io.iohk.ethereum.consensus.validators.std.StdBlockValidator import io.iohk.ethereum.consensus.validators.std.StdBlockValidator.{BlockLogBloomError, BlockOmmersHashError, BlockReceiptsHashError, BlockTransactionsHashError} import io.iohk.ethereum.domain._ import io.iohk.ethereum.ledger.BloomFilter -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockValidatorSpec extends FlatSpec with Matchers { +class BlockValidatorSpec extends AnyFlatSpec with Matchers { "Block" should "created based on valid data" in { val block = Block(validBlockHeader, validBlockBody) diff --git a/src/test/scala/io/iohk/ethereum/consensus/validators/OmmersValidatorSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/validators/OmmersValidatorSpec.scala index fcb74204a0..9f0d4660fe 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/validators/OmmersValidatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/validators/OmmersValidatorSpec.scala @@ -6,11 +6,12 @@ import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.consensus.ethash.validators.OmmersValidator.OmmersError._ import io.iohk.ethereum.consensus.ethash.validators.{EthashBlockHeaderValidator, StdOmmersValidator} import io.iohk.ethereum.domain.{Block, BlockBody, BlockHeader} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class OmmersValidatorSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { +class OmmersValidatorSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { it should "validate correctly a valid list of ommers" in new BlockUtils { ommersValidator.validate(ommersBlockParentHash, ommersBlockNumber, ommers, blockchain) match { diff --git a/src/test/scala/io/iohk/ethereum/consensus/validators/SignedTransactionValidatorSpec.scala b/src/test/scala/io/iohk/ethereum/consensus/validators/SignedTransactionValidatorSpec.scala index efb1e5876b..7c1dfb3d14 100644 --- a/src/test/scala/io/iohk/ethereum/consensus/validators/SignedTransactionValidatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/consensus/validators/SignedTransactionValidatorSpec.scala @@ -11,10 +11,11 @@ import io.iohk.ethereum.domain._ import io.iohk.ethereum.utils.Config import io.iohk.ethereum.vm.EvmConfig import io.iohk.ethereum.{Fixtures, crypto} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class SignedTransactionValidatorSpec extends FlatSpec with Matchers { +class SignedTransactionValidatorSpec extends AnyFlatSpec with Matchers { val blockchainConfig = Config.blockchains.blockchainConfig diff --git a/src/test/scala/io/iohk/ethereum/crypto/AesCbcSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/AesCbcSpec.scala index 54ee47e8f4..1442fcda6f 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/AesCbcSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/AesCbcSpec.scala @@ -2,11 +2,12 @@ package io.iohk.ethereum.crypto import java.nio.charset.StandardCharsets import akka.util.ByteString -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class AesCbcSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class AesCbcSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { "AES_CBC" should "correctly evaluate for the test vectors" in { diff --git a/src/test/scala/io/iohk/ethereum/crypto/AesCtrSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/AesCtrSpec.scala index fcc39b2229..156e1daff7 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/AesCtrSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/AesCtrSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.crypto import akka.util.ByteString -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class AesCtrSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class AesCtrSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { "AES_CTR" should "correctly evaluate for the test vectors" in { diff --git a/src/test/scala/io/iohk/ethereum/crypto/ECDSASignatureSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/ECDSASignatureSpec.scala index dccb1dbdae..dd879b3ab7 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/ECDSASignatureSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/ECDSASignatureSpec.scala @@ -4,12 +4,13 @@ import akka.util.ByteString import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import org.scalacheck.Arbitrary import org.scalacheck.Arbitrary.arbitrary -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.params.ECPublicKeyParameters import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ECDSASignatureSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { +class ECDSASignatureSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { "ECDSASignature" should "recover public key correctly for go ethereum transaction" in { val bytesToSign = Hex.decode("5a1465f4683bf2c18fc72c0789239c0f52b3ceac666ca9551cf265a11abe912c") val signatureRandom = ByteString(Hex.decode("f3af65a23fbf207b933d3c962381aa50e0ac19649c59c1af1655e592a8d95401")) diff --git a/src/test/scala/io/iohk/ethereum/crypto/ECIESCoderSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/ECIESCoderSpec.scala index 97d7723553..0e9ee2f2de 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/ECIESCoderSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/ECIESCoderSpec.scala @@ -3,12 +3,13 @@ package io.iohk.ethereum.crypto import java.math.BigInteger import io.iohk.ethereum.nodebuilder.SecureRandomBuilder -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.generators.ECKeyPairGenerator import org.bouncycastle.crypto.params.ECKeyGenerationParameters import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ECIESCoderSpec extends FlatSpec with Matchers with SecureRandomBuilder { +class ECIESCoderSpec extends AnyFlatSpec with Matchers with SecureRandomBuilder { "ECIESCoder" should "decrypt encrypted message" in { diff --git a/src/test/scala/io/iohk/ethereum/crypto/Pbkdf2HMacSha256Spec.scala b/src/test/scala/io/iohk/ethereum/crypto/Pbkdf2HMacSha256Spec.scala index 30706663a9..50bff9802b 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/Pbkdf2HMacSha256Spec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/Pbkdf2HMacSha256Spec.scala @@ -2,11 +2,12 @@ package io.iohk.ethereum.crypto import java.nio.charset.StandardCharsets import akka.util.ByteString -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class Pbkdf2HMacSha256Spec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class Pbkdf2HMacSha256Spec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { "pbkdf2HMacSha256" should "correctly evaluate for the test vectors" in { diff --git a/src/test/scala/io/iohk/ethereum/crypto/Ripemd160Spec.scala b/src/test/scala/io/iohk/ethereum/crypto/Ripemd160Spec.scala index 55687f70ad..3623658bcd 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/Ripemd160Spec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/Ripemd160Spec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.crypto import java.nio.charset.StandardCharsets -import org.scalatest.{FunSuite, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class Ripemd160Spec extends FunSuite with ScalaCheckPropertyChecks with Matchers { +class Ripemd160Spec extends AnyFunSuite with ScalaCheckPropertyChecks with Matchers { // these examples were taken from http://homes.esat.kuleuven.be/~bosselae/ripemd160.html#Outline val examples = Table[String, String]( diff --git a/src/test/scala/io/iohk/ethereum/crypto/ScryptSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/ScryptSpec.scala index 57f6d8c692..a3446dc233 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/ScryptSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/ScryptSpec.scala @@ -2,11 +2,12 @@ package io.iohk.ethereum.crypto import java.nio.charset.StandardCharsets import akka.util.ByteString -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ScryptSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class ScryptSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { "scrypt" should "correctly evaluate for the test vectors" in { diff --git a/src/test/scala/io/iohk/ethereum/crypto/zksnarks/BN128FpSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/zksnarks/BN128FpSpec.scala index c070b65b7a..199a3c3d05 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/zksnarks/BN128FpSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/zksnarks/BN128FpSpec.scala @@ -2,10 +2,10 @@ package io.iohk.ethereum.crypto.zksnarks import io.iohk.ethereum.crypto.zksnark.BN128.Point import io.iohk.ethereum.crypto.zksnark.{BN128Fp, Fp} -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class BN128FpSpec extends FunSuite with ScalaCheckPropertyChecks { +class BN128FpSpec extends AnyFunSuite with ScalaCheckPropertyChecks { val testData = Table[Fp, Fp, Fp]( ("x", "y", "z"), diff --git a/src/test/scala/io/iohk/ethereum/crypto/zksnarks/FpFieldSpec.scala b/src/test/scala/io/iohk/ethereum/crypto/zksnarks/FpFieldSpec.scala index d30cf0811c..17f3b9c647 100644 --- a/src/test/scala/io/iohk/ethereum/crypto/zksnarks/FpFieldSpec.scala +++ b/src/test/scala/io/iohk/ethereum/crypto/zksnarks/FpFieldSpec.scala @@ -4,10 +4,10 @@ import io.iohk.ethereum.crypto.zksnark._ import io.iohk.ethereum.crypto.zksnark.FiniteField.Ops._ import io.iohk.ethereum.vm.Generators._ import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -abstract class FieldSpec[T: FiniteField] extends FunSuite with ScalaCheckPropertyChecks { +abstract class FieldSpec[T: FiniteField] extends AnyFunSuite with ScalaCheckPropertyChecks { def fpGenerator: Gen[Fp] = bigIntGen.map(Fp(_)).retryUntil(fp => fp.isValid()) def fp2Generator: Gen[Fp2] = for { diff --git a/src/test/scala/io/iohk/ethereum/db/dataSource/DataSourceTestBehavior.scala b/src/test/scala/io/iohk/ethereum/db/dataSource/DataSourceTestBehavior.scala index 3fc40e09b0..22bdc24748 100644 --- a/src/test/scala/io/iohk/ethereum/db/dataSource/DataSourceTestBehavior.scala +++ b/src/test/scala/io/iohk/ethereum/db/dataSource/DataSourceTestBehavior.scala @@ -2,22 +2,22 @@ package io.iohk.ethereum.db.dataSource import java.io.File import java.nio.file.Files + import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.DataSource.{Key, Namespace, Value} -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks trait DataSourceTestBehavior extends ScalaCheckPropertyChecks with ObjectGenerators { - - this: FlatSpec => + this: AnyFlatSpec => val KeySizeWithoutPrefix: Int = 32 val OtherNamespace: IndexedSeq[Byte] = IndexedSeq[Byte]('r'.toByte) def prepareUpdate( - namespace: Namespace = OtherNamespace, - toRemove: Seq[Key] = Nil, - toUpsert: Seq[(Key, Value)] = Nil + namespace: Namespace = OtherNamespace, + toRemove: Seq[Key] = Nil, + toUpsert: Seq[(Key, Value)] = Nil ): Seq[DataSourceUpdate] = Seq(DataSourceUpdate(namespace, toRemove, toUpsert)) diff --git a/src/test/scala/io/iohk/ethereum/db/dataSource/EphemDataSourceSuite.scala b/src/test/scala/io/iohk/ethereum/db/dataSource/EphemDataSourceSuite.scala index a5551bad29..627ffde189 100644 --- a/src/test/scala/io/iohk/ethereum/db/dataSource/EphemDataSourceSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/dataSource/EphemDataSourceSuite.scala @@ -3,10 +3,10 @@ package io.iohk.ethereum.db.dataSource import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class EphemDataSourceSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class EphemDataSourceSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { val KeySize: Int = 32 val KeyNumberLimit: Int = 40 diff --git a/src/test/scala/io/iohk/ethereum/db/dataSource/RocksDbDataSourceTest.scala b/src/test/scala/io/iohk/ethereum/db/dataSource/RocksDbDataSourceTest.scala index ecbc2b42f1..45c6d203ae 100644 --- a/src/test/scala/io/iohk/ethereum/db/dataSource/RocksDbDataSourceTest.scala +++ b/src/test/scala/io/iohk/ethereum/db/dataSource/RocksDbDataSourceTest.scala @@ -3,9 +3,9 @@ package io.iohk.ethereum.db.dataSource import java.nio.file.Files import io.iohk.ethereum.db.storage.Namespaces -import org.scalatest.FlatSpec +import org.scalatest.flatspec.AnyFlatSpec -class RocksDbDataSourceTest extends FlatSpec with DataSourceTestBehavior { +class RocksDbDataSourceTest extends AnyFlatSpec with DataSourceTestBehavior { private def createDataSource(path: String): RocksDbDataSource = { val dbPath: String = Files.createTempDirectory("temp-test-rocksdb").toAbsolutePath.toString diff --git a/src/test/scala/io/iohk/ethereum/db/storage/AppStateStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/AppStateStorageSpec.scala index 0575f7a2a7..16d40ce386 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/AppStateStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/AppStateStorageSpec.scala @@ -2,13 +2,10 @@ package io.iohk.ethereum.db.storage import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks -class AppStateStorageSpec - extends WordSpec - with ScalaCheckPropertyChecks - with ObjectGenerators { +class AppStateStorageSpec extends AnyWordSpec with ScalaCheckPropertyChecks with ObjectGenerators { "AppStateStorage" should { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/BlockBodiesStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/BlockBodiesStorageSpec.scala index a8a1309657..344c9998f3 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/BlockBodiesStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/BlockBodiesStorageSpec.scala @@ -7,11 +7,11 @@ import io.iohk.ethereum.network.p2p.messages.CommonMessages.NewBlock import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import org.bouncycastle.util.encoders.Hex import org.scalacheck.Gen -import org.scalatest.WordSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.wordspec.AnyWordSpec class BlockBodiesStorageSpec - extends WordSpec + extends AnyWordSpec with ScalaCheckPropertyChecks with ObjectGenerators with SecureRandomBuilder { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/BlockHeadersStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/BlockHeadersStorageSpec.scala index 588d75a963..4167a955fc 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/BlockHeadersStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/BlockHeadersStorageSpec.scala @@ -4,10 +4,10 @@ import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.domain.BlockHeader import org.scalacheck.Gen -import org.scalatest.WordSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.wordspec.AnyWordSpec -class BlockHeadersStorageSpec extends WordSpec with ScalaCheckPropertyChecks with ObjectGenerators { +class BlockHeadersStorageSpec extends AnyWordSpec with ScalaCheckPropertyChecks with ObjectGenerators { "BlockHeadersStorage" should { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/CachedNodeStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/CachedNodeStorageSpec.scala index ff35ccacdd..27dee2cd6b 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/CachedNodeStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/CachedNodeStorageSpec.scala @@ -7,12 +7,13 @@ import io.iohk.ethereum.db.cache.MapCache import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.db.storage.NodeStorage.{NodeEncoded, NodeHash} import io.iohk.ethereum.utils.Config.NodeCacheConfig -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.duration._ import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class CachedNodeStorageSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { +class CachedNodeStorageSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { val iterations = 10 "CachedNodeStorage" should "not update dataSource until persist" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/CachedReferenceCountedStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/CachedReferenceCountedStorageSpec.scala index e65403567f..bf0bc1bce6 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/CachedReferenceCountedStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/CachedReferenceCountedStorageSpec.scala @@ -5,16 +5,17 @@ import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.mpt.NodesKeyValueStorage -import org.scalatest.{FlatSpec, Matchers} import io.iohk.ethereum.crypto.kec256 import io.iohk.ethereum.db.cache.LruCache import io.iohk.ethereum.utils.Config.NodeCacheConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number class CachedReferenceCountedStorageSpec - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/CodeStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/CodeStorageSuite.scala index 14b63c4151..66cf2175ba 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/CodeStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/CodeStorageSuite.scala @@ -4,10 +4,10 @@ import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class CodeStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class CodeStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { val LimitCodeSize = 100 test("CodeStorage insert") { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/KeyValueStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/KeyValueStorageSuite.scala index c4aa2b7d1b..928cb7e37f 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/KeyValueStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/KeyValueStorageSuite.scala @@ -5,10 +5,10 @@ import io.iohk.ethereum.db.dataSource.{DataSource, DataSourceUpdate, EphemDataSo import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.rlp.{decode => rlpDecode, encode => rlpEncode} import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class KeyValueStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class KeyValueStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { val iterationsNumber = 100 object IntStorage { diff --git a/src/test/scala/io/iohk/ethereum/db/storage/NodeStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/NodeStorageSuite.scala index 17b310a06e..2ed3fc37cc 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/NodeStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/NodeStorageSuite.scala @@ -6,10 +6,10 @@ import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.network.p2p.messages.PV63.MptNodeEncoders._ import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class NodeStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class NodeStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("NodeStorage insert") { forAll(Gen.listOf(nodeGen)) { unfilteredMptNodes => val mptNodes = unfilteredMptNodes.distinct diff --git a/src/test/scala/io/iohk/ethereum/db/storage/ReadOnlyNodeStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/ReadOnlyNodeStorageSpec.scala index 55bbc6d7c1..578070c01b 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/ReadOnlyNodeStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/ReadOnlyNodeStorageSpec.scala @@ -10,11 +10,12 @@ import io.iohk.ethereum.db.storage.StateStorage.{GenesisDataLoad, RollBackFlush} import io.iohk.ethereum.db.storage.pruning.InMemoryPruning import io.iohk.ethereum.mpt.LeafNode import io.iohk.ethereum.utils.Config.NodeCacheConfig -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ReadOnlyNodeStorageSpec extends FlatSpec with Matchers { +class ReadOnlyNodeStorageSpec extends AnyFlatSpec with Matchers { "ReadOnlyNodeStorage" should "not update dataSource" in new TestSetup { val readOnlyNodeStorage = stateStorage.getReadOnlyStorage diff --git a/src/test/scala/io/iohk/ethereum/db/storage/ReceiptStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/ReceiptStorageSuite.scala index ca66ac3384..af24021321 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/ReceiptStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/ReceiptStorageSuite.scala @@ -4,10 +4,10 @@ import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.domain.Receipt import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class ReceiptStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class ReceiptStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("ReceiptStorage insert") { forAll(Gen.listOf(byteStringOfLengthNGen(32))) { blockByteArrayHashes => diff --git a/src/test/scala/io/iohk/ethereum/db/storage/ReferenceCountNodeStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/ReferenceCountNodeStorageSpec.scala index 4786486ecb..29fe5656b2 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/ReferenceCountNodeStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/ReferenceCountNodeStorageSpec.scala @@ -7,11 +7,12 @@ import io.iohk.ethereum.db.cache.MapCache import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.mpt.NodesKeyValueStorage import io.iohk.ethereum.utils.Config.NodeCacheConfig -import org.scalatest.{FlatSpec, Matchers} import io.iohk.ethereum.crypto.kec256 import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ReferenceCountNodeStorageSpec extends FlatSpec with Matchers { +class ReferenceCountNodeStorageSpec extends AnyFlatSpec with Matchers { "ReferenceCountNodeStorage" should "not remove a key if no more references until pruning" in new TestSetup { val storage = new ReferenceCountNodeStorage(nodeStorage, 1) diff --git a/src/test/scala/io/iohk/ethereum/db/storage/StateStorageSpec.scala b/src/test/scala/io/iohk/ethereum/db/storage/StateStorageSpec.scala index 81da69b96c..309db02036 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/StateStorageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/StateStorageSpec.scala @@ -9,11 +9,12 @@ import io.iohk.ethereum.db.storage.NodeStorage.{NodeEncoded, NodeHash} import io.iohk.ethereum.db.storage.pruning.{ArchivePruning, BasicPruning, InMemoryPruning} import io.iohk.ethereum.mpt.NodesKeyValueStorage import io.iohk.ethereum.utils.Config.NodeCacheConfig -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class StateStorageSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { +class StateStorageSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { def saveNodeToDbTest(storage: StateStorage, nodeStorage: NodesKeyValueStorage): Unit = { forAll(keyValueByteStringGen(32)) { keyvals => diff --git a/src/test/scala/io/iohk/ethereum/db/storage/TotalDifficultyStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/TotalDifficultyStorageSuite.scala index 16f5e16c43..efb0c7e44a 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/TotalDifficultyStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/TotalDifficultyStorageSuite.scala @@ -3,10 +3,10 @@ package io.iohk.ethereum.db.storage import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class TotalDifficultyStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class TotalDifficultyStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("TotalDifficultyStorage insert") { forAll(Gen.listOf(byteStringOfLengthNGen(32))) { blockByteArrayHashes => val blockHashes = blockByteArrayHashes.distinct diff --git a/src/test/scala/io/iohk/ethereum/db/storage/TransactionMappingStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/TransactionMappingStorageSuite.scala index f1f5230565..ee759a9b0c 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/TransactionMappingStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/TransactionMappingStorageSuite.scala @@ -4,10 +4,10 @@ import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.db.storage.TransactionMappingStorage.TransactionLocation import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class TransactionMappingStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class TransactionMappingStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("TransactionMappingStorage insert") { forAll(Gen.listOf(byteStringOfLengthNGen(32))) { txByteArrayHashes => val txHashes = txByteArrayHashes.distinct diff --git a/src/test/scala/io/iohk/ethereum/db/storage/TransactionalKeyValueStorageSuite.scala b/src/test/scala/io/iohk/ethereum/db/storage/TransactionalKeyValueStorageSuite.scala index 5b92a98a02..ef2dcdda28 100644 --- a/src/test/scala/io/iohk/ethereum/db/storage/TransactionalKeyValueStorageSuite.scala +++ b/src/test/scala/io/iohk/ethereum/db/storage/TransactionalKeyValueStorageSuite.scala @@ -5,10 +5,10 @@ import io.iohk.ethereum.db.dataSource.{DataSource, DataSourceUpdate, EphemDataSo import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.rlp.{decode => rlpDecode, encode => rlpEncode} import org.scalacheck.Gen -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class TransactionalKeyValueStorageSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class TransactionalKeyValueStorageSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { val iterationsNumber = 100 object IntStorage { diff --git a/src/test/scala/io/iohk/ethereum/domain/ArbitraryIntegerMptSpec.scala b/src/test/scala/io/iohk/ethereum/domain/ArbitraryIntegerMptSpec.scala index af7a971249..df94331f58 100644 --- a/src/test/scala/io/iohk/ethereum/domain/ArbitraryIntegerMptSpec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/ArbitraryIntegerMptSpec.scala @@ -3,12 +3,13 @@ package io.iohk.ethereum.domain import akka.util.ByteString import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.mpt.MerklePatriciaTrie -import org.scalatest.{FlatSpec, Matchers} import io.iohk.ethereum.vm.Generators._ import org.scalacheck.Gen import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ArbitraryIntegerMptSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class ArbitraryIntegerMptSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { implicit val bigIntListNoShrink = noShrink[List[BigInt]] diff --git a/src/test/scala/io/iohk/ethereum/domain/BlockHeaderSpec.scala b/src/test/scala/io/iohk/ethereum/domain/BlockHeaderSpec.scala index 66c7b569a0..e597c760cf 100644 --- a/src/test/scala/io/iohk/ethereum/domain/BlockHeaderSpec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/BlockHeaderSpec.scala @@ -3,21 +3,24 @@ package io.iohk.ethereum.domain import akka.util.ByteString import io.iohk.ethereum.domain.BlockHeader._ import io.iohk.ethereum.ObjectGenerators -import org.scalatest.{FreeSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks -class BlockHeaderSpec extends FreeSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { +class BlockHeaderSpec extends AnyFreeSpec with Matchers with ScalaCheckPropertyChecks with ObjectGenerators { "Block header encoding" - { "without nonce should be compatible with EthereumJ blocks" in new TestSetup { //Expected values obtained using EthereumJ val obtainedBlock1EncodedWithoutNonce = Hex.toHexString(BlockHeader.getEncodedWithoutNonce(block1)) - val expectedBlock1EncodedWithoutNonce = "f901e6a0d882d5c210bab4cb7ef0b9f3dc2130cb680959afcd9a8f9bf83ee6f13e2f9da3a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479495f484419881c6e9b6de7fb3f8ad03763bd49a89a0634a2b20c9e02afdda7157afe384306c5acc4fb9c09b45dc0203c0fbb2fed0e6a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830f1a4c148407d85e8f8084589e0ab998d783010507846765746887676f312e372e33856c696e7578" + val expectedBlock1EncodedWithoutNonce = + "f901e6a0d882d5c210bab4cb7ef0b9f3dc2130cb680959afcd9a8f9bf83ee6f13e2f9da3a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479495f484419881c6e9b6de7fb3f8ad03763bd49a89a0634a2b20c9e02afdda7157afe384306c5acc4fb9c09b45dc0203c0fbb2fed0e6a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830f1a4c148407d85e8f8084589e0ab998d783010507846765746887676f312e372e33856c696e7578" assert(obtainedBlock1EncodedWithoutNonce == expectedBlock1EncodedWithoutNonce) val obtainedBlock2EncodedWithoutNonce = Hex.toHexString(BlockHeader.getEncodedWithoutNonce(block2)) - val expectedBlock2EncodedWithoutNonce = "f901e6a0677a5fb51d52321b03552e3c667f602cc489d15fc1d7824445aee6d94a9db2e7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479495f484419881c6e9b6de7fb3f8ad03763bd49a89a0cddeeb071e2f69ad765406fb7c96c0cd42ddfc6ec54535822b564906f9e38e44a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830f1869138407da55238084589e0ab898d783010507846765746887676f312e372e33856c696e7578" + val expectedBlock2EncodedWithoutNonce = + "f901e6a0677a5fb51d52321b03552e3c667f602cc489d15fc1d7824445aee6d94a9db2e7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479495f484419881c6e9b6de7fb3f8ad03763bd49a89a0cddeeb071e2f69ad765406fb7c96c0cd42ddfc6ec54535822b564906f9e38e44a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830f1869138407da55238084589e0ab898d783010507846765746887676f312e372e33856c696e7578" assert(obtainedBlock2EncodedWithoutNonce == expectedBlock2EncodedWithoutNonce) } diff --git a/src/test/scala/io/iohk/ethereum/domain/BlockSpec.scala b/src/test/scala/io/iohk/ethereum/domain/BlockSpec.scala index 2b842e6eab..40b72e4c89 100644 --- a/src/test/scala/io/iohk/ethereum/domain/BlockSpec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/BlockSpec.scala @@ -1,9 +1,10 @@ package io.iohk.ethereum.domain import io.iohk.ethereum.Fixtures.Blocks._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockSpec extends FlatSpec with Matchers { +class BlockSpec extends AnyFlatSpec with Matchers { "Block size" should "be correct" in { assert(Block.size(Genesis.block) == Genesis.size) assert(Block.size(Block3125369.block) == Block3125369.size) diff --git a/src/test/scala/io/iohk/ethereum/domain/BlockchainSpec.scala b/src/test/scala/io/iohk/ethereum/domain/BlockchainSpec.scala index d7f95339a7..7e23191b88 100644 --- a/src/test/scala/io/iohk/ethereum/domain/BlockchainSpec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/BlockchainSpec.scala @@ -6,9 +6,10 @@ import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.db.storage.StateStorage import io.iohk.ethereum.mpt.MerklePatriciaTrie -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockchainSpec extends FlatSpec with Matchers { +class BlockchainSpec extends AnyFlatSpec with Matchers { "Blockchain" should "be able to store a block and return if if queried by hash" in new EphemBlockchainTestSetup { val validBlock = Fixtures.Blocks.ValidBlock.block diff --git a/src/test/scala/io/iohk/ethereum/domain/SignedTransactionSpec.scala b/src/test/scala/io/iohk/ethereum/domain/SignedTransactionSpec.scala index e042d27467..9f307d48f7 100644 --- a/src/test/scala/io/iohk/ethereum/domain/SignedTransactionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/SignedTransactionSpec.scala @@ -6,11 +6,12 @@ import io.iohk.ethereum.domain.SignedTransaction.FirstByteOfAddress import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.vm.Generators import org.scalacheck.Arbitrary -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.params.ECPublicKeyParameters import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class SignedTransactionSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { +class SignedTransactionSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { "SignedTransaction" should "correctly set pointSign for chainId with chain specific signing schema" in { forAll(Generators.transactionGen(), Arbitrary.arbitrary[Unit].map(_ => generateKeyPair(secureRandom))) { (tx, key) => diff --git a/src/test/scala/io/iohk/ethereum/domain/UInt256Spec.scala b/src/test/scala/io/iohk/ethereum/domain/UInt256Spec.scala index c6332cab9c..9ce0d3928c 100644 --- a/src/test/scala/io/iohk/ethereum/domain/UInt256Spec.scala +++ b/src/test/scala/io/iohk/ethereum/domain/UInt256Spec.scala @@ -2,11 +2,11 @@ package io.iohk.ethereum.domain import akka.util.ByteString import io.iohk.ethereum.vm.Generators._ -import org.scalatest.FunSuite import io.iohk.ethereum.domain.UInt256._ import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class UInt256Spec extends FunSuite with ScalaCheckPropertyChecks { +class UInt256Spec extends AnyFunSuite with ScalaCheckPropertyChecks { val Modulus: BigInt = UInt256.MaxValue.toBigInt + 1 val MaxSignedValue: BigInt = Modulus / 2 - 1 diff --git a/src/test/scala/io/iohk/ethereum/extvm/MessageHandlerSpec.scala b/src/test/scala/io/iohk/ethereum/extvm/MessageHandlerSpec.scala index 226626f50a..4cf57d2de5 100644 --- a/src/test/scala/io/iohk/ethereum/extvm/MessageHandlerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/extvm/MessageHandlerSpec.scala @@ -10,11 +10,12 @@ import io.iohk.ethereum.vm.Generators import java.math.BigInteger import org.bouncycastle.util.BigIntegers import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.ExecutionContext.Implicits.global +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class MessageHandlerSpec extends FlatSpec with Matchers with MockFactory with ScalaCheckPropertyChecks { +class MessageHandlerSpec extends AnyFlatSpec with Matchers with MockFactory with ScalaCheckPropertyChecks { import Implicits._ import akka.pattern.pipe diff --git a/src/test/scala/io/iohk/ethereum/extvm/VMClientSpec.scala b/src/test/scala/io/iohk/ethereum/extvm/VMClientSpec.scala index 2de0ce6b4b..43195fb630 100644 --- a/src/test/scala/io/iohk/ethereum/extvm/VMClientSpec.scala +++ b/src/test/scala/io/iohk/ethereum/extvm/VMClientSpec.scala @@ -8,10 +8,11 @@ import io.iohk.ethereum.utils.VmConfig import io.iohk.ethereum.vm.utils.MockVmInput import io.iohk.ethereum.vm._ import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class VMClientSpec extends FlatSpec with Matchers with MockFactory { +class VMClientSpec extends AnyFlatSpec with Matchers with MockFactory { import io.iohk.ethereum.Fixtures.Blocks._ import Implicits._ diff --git a/src/test/scala/io/iohk/ethereum/extvm/VMServerSpec.scala b/src/test/scala/io/iohk/ethereum/extvm/VMServerSpec.scala index 21bf8ffe6a..0a276f63b7 100644 --- a/src/test/scala/io/iohk/ethereum/extvm/VMServerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/extvm/VMServerSpec.scala @@ -5,9 +5,10 @@ import com.trueaccord.scalapb.GeneratedMessageCompanion import io.iohk.ethereum.domain.{Account, Address} import io.iohk.ethereum.extvm.msg.{CallContext, VMQuery} import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class VMServerSpec extends FlatSpec with Matchers with MockFactory { +class VMServerSpec extends AnyFlatSpec with Matchers with MockFactory { import io.iohk.ethereum.Fixtures.Blocks._ import Implicits._ diff --git a/src/test/scala/io/iohk/ethereum/extvm/WorldSpec.scala b/src/test/scala/io/iohk/ethereum/extvm/WorldSpec.scala index 2ac86066d1..e10c374c28 100644 --- a/src/test/scala/io/iohk/ethereum/extvm/WorldSpec.scala +++ b/src/test/scala/io/iohk/ethereum/extvm/WorldSpec.scala @@ -4,10 +4,11 @@ import akka.util.ByteString import com.trueaccord.scalapb.GeneratedMessageCompanion import io.iohk.ethereum.domain.{Account, Address, UInt256} import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class WorldSpec extends FlatSpec with Matchers with MockFactory { +class WorldSpec extends AnyFlatSpec with Matchers with MockFactory { import Implicits._ diff --git a/src/test/scala/io/iohk/ethereum/faucet/FaucetApiSpec.scala b/src/test/scala/io/iohk/ethereum/faucet/FaucetApiSpec.scala index 4ac5f8bf48..052d9e16df 100644 --- a/src/test/scala/io/iohk/ethereum/faucet/FaucetApiSpec.scala +++ b/src/test/scala/io/iohk/ethereum/faucet/FaucetApiSpec.scala @@ -17,10 +17,11 @@ import java.security.SecureRandom import java.time.{Clock, Instant} import org.bouncycastle.util.encoders.Hex import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class FaucetApiSpec extends FlatSpec with Matchers with MockFactory with ScalatestRouteTest { +class FaucetApiSpec extends AnyFlatSpec with Matchers with MockFactory with ScalatestRouteTest { "FaucetApi" should "send a transaction" in { val walletKeyPair = generateKeyPair(new SecureRandom) diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/DebugServiceSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/DebugServiceSpec.scala index d5ae8d7fa3..327509c4a4 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/DebugServiceSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/DebugServiceSpec.scala @@ -13,9 +13,10 @@ import io.iohk.ethereum.network.p2p.messages.Versions import io.iohk.ethereum.network.{ EtcPeerManagerActor, Peer, PeerActor, PeerManagerActor } import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{ FlatSpec, Matchers } +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class DebugServiceSpec extends FlatSpec with Matchers with MockFactory with ScalaFutures { +class DebugServiceSpec extends AnyFlatSpec with Matchers with MockFactory with ScalaFutures { "DebugService" should "return list of peers info" in new TestSetup { val result: ServiceResponse[ListPeersInfoResponse] = diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/EthServiceSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/EthServiceSpec.scala index 3812f82b66..976d3d6190 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/EthServiceSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/EthServiceSpec.scala @@ -27,14 +27,15 @@ import org.bouncycastle.util.encoders.Hex import org.scalactic.TypeCheckedTripleEquals import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.Await import scala.concurrent.duration.{Duration, DurationInt, FiniteDuration} // scalastyle:off file.size.limit class EthServiceSpec - extends FlatSpec + extends AnyFlatSpec with Matchers with ScalaFutures with MockFactory diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/ExpiringMapSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/ExpiringMapSpec.scala index bfffeb36fa..0f6cf4c1cb 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/ExpiringMapSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/ExpiringMapSpec.scala @@ -5,9 +5,10 @@ import java.time.Duration import io.iohk.ethereum.domain.{Account, Address} import org.scalatest.concurrent.Eventually import org.scalatest.time.{Millis, Span} -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ExpiringMapSpec extends FlatSpec with Matchers with Eventually { +class ExpiringMapSpec extends AnyFlatSpec with Matchers with Eventually { val testResolution = 20 val holdTime = 100 diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/FilterManagerSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/FilterManagerSpec.scala index 2f1b106ed4..491fe12e92 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/FilterManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/FilterManagerSpec.scala @@ -8,7 +8,6 @@ import io.iohk.ethereum.domain._ import io.iohk.ethereum.jsonrpc.EthService.BlockParam import io.iohk.ethereum.keystore.KeyStore import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import akka.pattern.ask import com.miguno.akka.testing.VirtualTime @@ -25,8 +24,10 @@ import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.scalatest.concurrent.ScalaFutures import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class FilterManagerSpec extends FlatSpec with Matchers with ScalaFutures with NormalPatience { +class FilterManagerSpec extends AnyFlatSpec with Matchers with ScalaFutures with NormalPatience { "FilterManager" should "handle log filter logs and changes" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/JRCMatchers.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/JRCMatchers.scala index 23a101a8c8..d8aee796e9 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/JRCMatchers.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/JRCMatchers.scala @@ -3,8 +3,8 @@ package io.iohk.ethereum.jsonrpc import akka.util.ByteString import io.iohk.ethereum.utils.ByteStringUtils import org.json4s.JsonAST.{JBool, JDecimal, JInt, JObject, JString, JValue} -import org.scalatest.Matchers import org.scalatest.matchers.{MatchResult, Matcher} +import org.scalatest.matchers.should.Matchers trait JRCMatchers extends Matchers { diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/JsonRpcControllerSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/JsonRpcControllerSpec.scala index e592ee58df..4536e3d578 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/JsonRpcControllerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/JsonRpcControllerSpec.scala @@ -42,15 +42,16 @@ import org.json4s.JsonDSL._ import org.json4s.{DefaultFormats, Extraction, Formats} import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.{Eventually, ScalaFutures} -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.Future import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off file.size.limit // scalastyle:off magic.number class JsonRpcControllerSpec - extends FlatSpec + extends AnyFlatSpec with Matchers with JRCMatchers with ScalaCheckPropertyChecks diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/NetServiceSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/NetServiceSpec.scala index eb069ae235..84174d0708 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/NetServiceSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/NetServiceSpec.scala @@ -10,10 +10,11 @@ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils.{NodeStatus, ServerStatus} import java.util.concurrent.atomic.AtomicReference import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class NetServiceSpec extends FlatSpec with Matchers with ScalaFutures with NormalPatience with SecureRandomBuilder { +class NetServiceSpec extends AnyFlatSpec with Matchers with ScalaFutures with NormalPatience with SecureRandomBuilder { "NetService" should "return handshaked peer count" in new TestSetup { val resF = netService.peerCount(PeerCountRequest()) diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/PersonalServiceSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/PersonalServiceSpec.scala index a850542472..7eb4d5bb9a 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/PersonalServiceSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/PersonalServiceSpec.scala @@ -1,6 +1,7 @@ package io.iohk.ethereum.jsonrpc import java.time.Duration + import akka.actor.ActorSystem import akka.testkit.TestProbe import akka.util.ByteString @@ -15,17 +16,20 @@ import io.iohk.ethereum.keystore.{KeyStore, Wallet} import io.iohk.ethereum.transactions.PendingTransactionsManager._ import io.iohk.ethereum.utils.{BlockchainConfig, MonetaryPolicyConfig, TxPoolConfig} import io.iohk.ethereum.{Fixtures, NormalPatience, Timeouts} -import org.scalamock.matchers.Matcher +import org.bouncycastle.util.encoders.Hex +import org.scalamock.matchers.MatcherBase import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.{Eventually, ScalaFutures} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Millis, Seconds, Span} -import org.scalatest.{FlatSpec, Matchers} -import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks + import scala.concurrent.duration.FiniteDuration +import scala.reflect.ClassTag class PersonalServiceSpec - extends FlatSpec + extends AnyFlatSpec with Matchers with MockFactory with ScalaFutures @@ -436,10 +440,9 @@ class PersonalServiceSpec val nonce = 7 val txValue = 128000 - val blockchainConfig = BlockchainConfig ( + val blockchainConfig = BlockchainConfig( eip155BlockNumber = 12345, chainId = 0x03.toByte, - //unused networkId = 1, maxCodeSize = None, @@ -494,7 +497,7 @@ class PersonalServiceSpec val personal = new PersonalService(keyStore, blockchain, txPool.ref, appStateStorage, blockchainConfig, txPoolConfig) - def array[T](arr: Array[T]): Matcher[Array[T]] = + def array[T](arr: Array[T])(implicit ev: ClassTag[Array[T]]): MatcherBase = argThat((_: Array[T]) sameElements arr) } } diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/QaJRCSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/QaJRCSpec.scala index bf4756f0b2..79ef0d5718 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/QaJRCSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/QaJRCSpec.scala @@ -20,10 +20,11 @@ import io.iohk.ethereum.utils.Config import org.json4s.JsonAST._ import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{Matchers, WordSpec} import scala.concurrent.Future +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class QaJRCSpec extends WordSpec with Matchers with ScalaFutures with NormalPatience with JsonMethodsImplicits { +class QaJRCSpec extends AnyWordSpec with Matchers with ScalaFutures with NormalPatience with JsonMethodsImplicits { "QaJRC" should { "request block mining and return valid response with correct message" when { diff --git a/src/test/scala/io/iohk/ethereum/jsonrpc/server/http/JsonRpcHttpServerSpec.scala b/src/test/scala/io/iohk/ethereum/jsonrpc/server/http/JsonRpcHttpServerSpec.scala index 35ab98068c..6008c799db 100644 --- a/src/test/scala/io/iohk/ethereum/jsonrpc/server/http/JsonRpcHttpServerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/jsonrpc/server/http/JsonRpcHttpServerSpec.scala @@ -10,10 +10,11 @@ import io.iohk.ethereum.jsonrpc.server.http.JsonRpcHttpServer.JsonRpcHttpServerC import io.iohk.ethereum.jsonrpc.{JsonRpcController, JsonRpcResponse} import org.json4s.JsonAST.{JInt, JString} import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.Future +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class JsonRpcHttpServerSpec extends FlatSpec with Matchers with ScalatestRouteTest { +class JsonRpcHttpServerSpec extends AnyFlatSpec with Matchers with ScalatestRouteTest { it should "pass valid json request to controller" in new TestSetup { (mockJsonRpcController.handleRequest _).expects(*).returning(Future.successful(JsonRpcResponse("2.0", Some(JString("this is a response")), None, JInt(1)))) diff --git a/src/test/scala/io/iohk/ethereum/keystore/EncryptedKeySpec.scala b/src/test/scala/io/iohk/ethereum/keystore/EncryptedKeySpec.scala index ec56e0155a..dacb1f331f 100644 --- a/src/test/scala/io/iohk/ethereum/keystore/EncryptedKeySpec.scala +++ b/src/test/scala/io/iohk/ethereum/keystore/EncryptedKeySpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.keystore -import org.scalatest.{FlatSpec, Matchers} import io.iohk.ethereum.crypto import io.iohk.ethereum.domain.Address import io.iohk.ethereum.nodebuilder.SecureRandomBuilder +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class EncryptedKeySpec extends FlatSpec with Matchers with SecureRandomBuilder { +class EncryptedKeySpec extends AnyFlatSpec with Matchers with SecureRandomBuilder { val gethKey = """{ diff --git a/src/test/scala/io/iohk/ethereum/keystore/KeyStoreImplSpec.scala b/src/test/scala/io/iohk/ethereum/keystore/KeyStoreImplSpec.scala index 1e212efb1c..0765feefe7 100644 --- a/src/test/scala/io/iohk/ethereum/keystore/KeyStoreImplSpec.scala +++ b/src/test/scala/io/iohk/ethereum/keystore/KeyStoreImplSpec.scala @@ -10,11 +10,13 @@ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils.{Config, KeyStoreConfig} import org.apache.commons.io.FileUtils import org.bouncycastle.util.encoders.Hex -import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers} +import org.scalatest.BeforeAndAfter import scala.util.Try +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class KeyStoreImplSpec extends FlatSpec with Matchers with BeforeAndAfter with SecureRandomBuilder { +class KeyStoreImplSpec extends AnyFlatSpec with Matchers with BeforeAndAfter with SecureRandomBuilder { before(clearKeyStore()) diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockExecutionSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockExecutionSpec.scala index 73b9c52025..cb923f1c24 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockExecutionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockExecutionSpec.scala @@ -9,11 +9,12 @@ import io.iohk.ethereum.domain._ import io.iohk.ethereum.ledger.Ledger.BlockResult import io.iohk.ethereum.vm.OutOfGas import org.scalatest.prop.TableFor4 -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off magic.number -class BlockExecutionSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { "BlockExecution" should { diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockImportSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockImportSpec.scala index 698d19115f..cf68237869 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockImportSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockImportSpec.scala @@ -9,12 +9,13 @@ import io.iohk.ethereum.consensus.validators._ import io.iohk.ethereum.domain._ import io.iohk.ethereum.ledger.BlockQueue.Leaf import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{ FlatSpec, Matchers } import scala.concurrent.duration._ import scala.language.postfixOps +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockImportSpec extends FlatSpec with Matchers with ScalaFutures { +class BlockImportSpec extends AnyFlatSpec with Matchers with ScalaFutures { override implicit val patienceConfig: PatienceConfig = PatienceConfig(timeout = scaled(2 seconds), interval = scaled(1 second)) diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockPreparatorSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockPreparatorSpec.scala index f6fc20a1fc..f9675599ae 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockPreparatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockPreparatorSpec.scala @@ -14,11 +14,12 @@ import io.iohk.ethereum.vm._ import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.crypto.params.ECPublicKeyParameters import org.scalatest.prop.{TableFor2, TableFor4} -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off magic.number -class BlockPreparatorSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class BlockPreparatorSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { "BlockPreparator" should { diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockQueueSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockQueueSpec.scala index 3d3d1b491f..ed02e12a6f 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockQueueSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockQueueSpec.scala @@ -8,9 +8,10 @@ import io.iohk.ethereum.ledger.BlockQueue.Leaf import io.iohk.ethereum.utils.Config import io.iohk.ethereum.utils.Config.SyncConfig import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockQueueSpec extends FlatSpec with Matchers with MockFactory { +class BlockQueueSpec extends AnyFlatSpec with Matchers with MockFactory { "BlockQueue" should "ignore block if it's already in the queue" in new TestConfig { val block = getBlock(1) diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockRewardCalculatorSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockRewardCalculatorSpec.scala index 4c6f411907..02983f75c0 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockRewardCalculatorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockRewardCalculatorSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.ledger import io.iohk.ethereum.utils.MonetaryPolicyConfig -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number -class BlockRewardCalculatorSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class BlockRewardCalculatorSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { "BlockRewardCalculator" should "correctly calculate block and ommer rewards" in { val standardMP = diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockRewardSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockRewardSpec.scala index d9e8df1454..d42ded5cb2 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockRewardSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockRewardSpec.scala @@ -8,9 +8,10 @@ import io.iohk.ethereum.ledger.Ledger.VMImpl import io.iohk.ethereum.utils.Config import io.iohk.ethereum.utils.Config.SyncConfig import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlockRewardSpec extends FlatSpec with Matchers with MockFactory { +class BlockRewardSpec extends AnyFlatSpec with Matchers with MockFactory { val blockchainConfig = Config.blockchains.blockchainConfig val syncConfig = SyncConfig(Config.config) diff --git a/src/test/scala/io/iohk/ethereum/ledger/BlockValidationSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BlockValidationSpec.scala index 7ce86a154a..0fd5904bb1 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BlockValidationSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BlockValidationSpec.scala @@ -6,9 +6,10 @@ import io.iohk.ethereum.consensus.validators.std.StdBlockValidator import io.iohk.ethereum.domain._ import org.bouncycastle.util.encoders.Hex import org.scalamock.scalatest.MockFactory -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class BlockValidationSpec extends WordSpec with Matchers with MockFactory { +class BlockValidationSpec extends AnyWordSpec with Matchers with MockFactory { "BlockValidation" should { "validate block after execution" when { diff --git a/src/test/scala/io/iohk/ethereum/ledger/BloomFilterSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BloomFilterSpec.scala index 96c5864f25..be26dd6826 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BloomFilterSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BloomFilterSpec.scala @@ -2,10 +2,11 @@ package io.iohk.ethereum.ledger import akka.util.ByteString import io.iohk.ethereum.domain.{Address, Receipt, TxLogEntry} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BloomFilterSpec extends FlatSpec with Matchers { +class BloomFilterSpec extends AnyFlatSpec with Matchers { it should "properly create the bloom filter for without logs" in { val obtained = BloomFilter.create(receiptWithoutLogs.logs) diff --git a/src/test/scala/io/iohk/ethereum/ledger/BranchResolutionSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/BranchResolutionSpec.scala index b8d689fa13..cfe859f11e 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/BranchResolutionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/BranchResolutionSpec.scala @@ -4,9 +4,10 @@ import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.domain.{Block, BlockBody, BlockHeader} import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{Matchers, WordSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class BranchResolutionSpec extends WordSpec with Matchers with ObjectGenerators with ScalaFutures { +class BranchResolutionSpec extends AnyWordSpec with Matchers with ObjectGenerators with ScalaFutures { "BranchResolution" should { diff --git a/src/test/scala/io/iohk/ethereum/ledger/DeleteAccountsSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/DeleteAccountsSpec.scala index 14d2043571..7d39c69939 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/DeleteAccountsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/DeleteAccountsSpec.scala @@ -7,9 +7,10 @@ import io.iohk.ethereum.ledger.Ledger.VMImpl import io.iohk.ethereum.utils.Config import io.iohk.ethereum.utils.Config.SyncConfig import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class DeleteAccountsSpec extends FlatSpec with Matchers with MockFactory { +class DeleteAccountsSpec extends AnyFlatSpec with Matchers with MockFactory { val blockchainConfig = Config.blockchains.blockchainConfig val syncConfig = SyncConfig(Config.config) diff --git a/src/test/scala/io/iohk/ethereum/ledger/DeleteTouchedAccountsSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/DeleteTouchedAccountsSpec.scala index 0ebee90b4d..60ef378e40 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/DeleteTouchedAccountsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/DeleteTouchedAccountsSpec.scala @@ -8,9 +8,10 @@ import io.iohk.ethereum.utils.Config import io.iohk.ethereum.utils.Config.SyncConfig import io.iohk.ethereum.vm.{BlockchainConfigForEvm, EvmConfig} import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class DeleteTouchedAccountsSpec extends FlatSpec with Matchers with MockFactory { +class DeleteTouchedAccountsSpec extends AnyFlatSpec with Matchers with MockFactory { val blockchainConfig = Config.blockchains.blockchainConfig val syncConfig = SyncConfig(Config.config) diff --git a/src/test/scala/io/iohk/ethereum/ledger/InMemorySimpleMapProxySpec.scala b/src/test/scala/io/iohk/ethereum/ledger/InMemorySimpleMapProxySpec.scala index 1669ef4304..b082e99133 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/InMemorySimpleMapProxySpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/InMemorySimpleMapProxySpec.scala @@ -6,9 +6,10 @@ import io.iohk.ethereum.common.SimpleMap import io.iohk.ethereum.db.dataSource.EphemDataSource import io.iohk.ethereum.db.storage.StateStorage import io.iohk.ethereum.mpt.{ByteArraySerializable, MerklePatriciaTrie} -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class InMemorySimpleMapProxySpec extends FlatSpec with Matchers { +class InMemorySimpleMapProxySpec extends AnyFlatSpec with Matchers { "InMemoryTrieProxy" should "not write inserts until commit" in new TestSetup { val updatedProxy = InMemorySimpleMapProxy.wrap[Int, Int, MerklePatriciaTrie[Int, Int]](mpt).put(1, 1).put(2, 2) diff --git a/src/test/scala/io/iohk/ethereum/ledger/InMemoryWorldStateProxySpec.scala b/src/test/scala/io/iohk/ethereum/ledger/InMemoryWorldStateProxySpec.scala index 8c3e3ee582..40a0b6ebbd 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/InMemoryWorldStateProxySpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/InMemoryWorldStateProxySpec.scala @@ -5,10 +5,11 @@ import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.domain.{Account, Address, BlockchainImpl, UInt256} import io.iohk.ethereum.mpt.MerklePatriciaTrie.MPTException import io.iohk.ethereum.vm.{EvmConfig, Generators} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class InMemoryWorldStateProxySpec extends FlatSpec with Matchers { +class InMemoryWorldStateProxySpec extends AnyFlatSpec with Matchers { "InMemoryWorldStateProxy" should "allow to create and retrieve an account" in new TestSetup { worldState.newEmptyAccount(address1).accountExists(address1) shouldBe true diff --git a/src/test/scala/io/iohk/ethereum/ledger/LedgerSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/LedgerSpec.scala index 606e7f2c0f..a05d896507 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/LedgerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/LedgerSpec.scala @@ -17,12 +17,13 @@ import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.util.encoders.Hex import org.scalatest.concurrent.ScalaFutures import org.scalatest.prop.{TableFor2, TableFor3, TableFor4} -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.concurrent.{ExecutionContext, ExecutionContextExecutor} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number -class LedgerSpec extends FlatSpec with ScalaCheckPropertyChecks with Matchers with ScalaFutures { +class LedgerSpec extends AnyFlatSpec with ScalaCheckPropertyChecks with Matchers with ScalaFutures { implicit val testContext: ExecutionContextExecutor = ExecutionContext.fromExecutor(Executors.newFixedThreadPool(4)) diff --git a/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala index 0c0ada27f6..53610bc379 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala @@ -3,16 +3,18 @@ package io.iohk.ethereum.ledger import akka.util.ByteString import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.crypto.ECDSASignature +import io.iohk.ethereum.domain.Block.BlockDec import io.iohk.ethereum.domain._ -import org.scalatest._ +import io.iohk.ethereum.mpt.MerklePatriciaTrie.MPTException import io.iohk.ethereum.utils._ import org.bouncycastle.util.encoders.Hex -import io.iohk.ethereum.domain.Block.BlockDec -import io.iohk.ethereum.mpt.MerklePatriciaTrie.MPTException +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class StxLedgerSpec extends FlatSpec with Matchers with Logger { +class StxLedgerSpec extends AnyFlatSpec with Matchers with Logger { "StxLedger" should "correctly estimate minimum gasLimit to run transaction which throws" in new ScenarioSetup { + /** * Transaction requires gasLimit equal to 121825, but actual gas used due to refund is equal 42907. * Our simulateTransaction properly estimates gas usage to 42907, but requires at least 121825 gas to @@ -101,7 +103,7 @@ class StxLedgerSpec extends FlatSpec with Matchers with Logger { // scalastyle:off magic.number line.size.limit trait ScenarioSetup extends EphemBlockchainTestSetup { - override lazy val blockchainConfig: BlockchainConfig = BlockchainConfig ( + override lazy val blockchainConfig: BlockchainConfig = BlockchainConfig( eip155BlockNumber = 0, chainId = 0x03.toByte, networkId = 1, @@ -157,9 +159,17 @@ trait ScenarioSetup extends EphemBlockchainTestSetup { * * @note Example from https://github.com/ethereum/go-ethereum/pull/3587 */ - val failingCode = ByteString(Hex.decode("60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806323fcf32a146100495780634f28bf0e146100a0575b610000565b346100005761009e600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610136565b005b34610000576100ad6101eb565b60405180806020018281038252838181518152602001915080519060200190808383600083146100fc575b8051825260208311156100fc576020820191506020810190506020830392506100d8565b505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b620186a05a101561014657610000565b8060009080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061019257805160ff19168380011785556101c0565b828001600101855582156101c0579182015b828111156101bf5782518255916020019190600101906101a4565b5b5090506101e591905b808211156101e15760008160009055506001016101c9565b5090565b50505b50565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102815780601f1061025657610100808354040283529160200191610281565b820191906000526020600020905b81548152906001019060200180831161026457829003601f168201915b5050505050815600a165627a7a7230582075b8ec2ccf191572d3bfdd93dee7d107668265f37d7918e48132b1ba16df17320029")) + val failingCode = ByteString( + Hex.decode( + "60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806323fcf32a146100495780634f28bf0e146100a0575b610000565b346100005761009e600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610136565b005b34610000576100ad6101eb565b60405180806020018281038252838181518152602001915080519060200190808383600083146100fc575b8051825260208311156100fc576020820191506020810190506020830392506100d8565b505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b620186a05a101561014657610000565b8060009080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061019257805160ff19168380011785556101c0565b828001600101855582156101c0579182015b828111156101bf5782518255916020019190600101906101a4565b5b5090506101e591905b808211156101e15760008160009055506001016101c9565b5090565b50505b50565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102815780601f1061025657610100808354040283529160200191610281565b820191906000526020600020905b81548152906001019060200180831161026457829003601f168201915b5050505050815600a165627a7a7230582075b8ec2ccf191572d3bfdd93dee7d107668265f37d7918e48132b1ba16df17320029" + ) + ) - val sendData = ByteString(Hex.decode("23fcf32a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000564756e6e6f000000000000000000000000000000000000000000000000000000")) + val sendData = ByteString( + Hex.decode( + "23fcf32a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000564756e6e6f000000000000000000000000000000000000000000000000000000" + ) + ) val fromBalance = UInt256(10) val fromAddress = Address(0) @@ -174,7 +184,9 @@ trait ScenarioSetup extends EphemBlockchainTestSetup { ) val someGenesisBlock: Array[Byte] = - Hex.decode("f901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421880102030405060708c0c0") + Hex.decode( + "f901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421880102030405060708c0c0" + ) val minGasLimitRequiredForFailingTransaction: BigInt = 121825 @@ -185,7 +197,8 @@ trait ScenarioSetup extends EphemBlockchainTestSetup { val genesisHeader: BlockHeader = genesisBlock.header val lastBlockGasLimit: BigInt = genesisBlock.header.gasLimit - blockchain.storeBlock(genesisBlock) + blockchain + .storeBlock(genesisBlock) .and(blockchain.storeReceipts(genesisHash, Nil)) .and(blockchain.storeTotalDifficulty(genesisHash, genesisBlock.header.difficulty)) .commit() diff --git a/src/test/scala/io/iohk/ethereum/mpt/HexPrefixSuite.scala b/src/test/scala/io/iohk/ethereum/mpt/HexPrefixSuite.scala index d37b20149f..880a4445c7 100644 --- a/src/test/scala/io/iohk/ethereum/mpt/HexPrefixSuite.scala +++ b/src/test/scala/io/iohk/ethereum/mpt/HexPrefixSuite.scala @@ -1,10 +1,10 @@ package io.iohk.ethereum.mpt import io.iohk.ethereum.ObjectGenerators -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class HexPrefixSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class HexPrefixSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("HexPrefix encoding") { forAll(hexPrefixDecodeParametersGen()) { pair: (Array[Byte], Boolean) => diff --git a/src/test/scala/io/iohk/ethereum/mpt/MerklePatriciaTrieSuite.scala b/src/test/scala/io/iohk/ethereum/mpt/MerklePatriciaTrieSuite.scala index da14fe9698..aa3fc4bd8c 100644 --- a/src/test/scala/io/iohk/ethereum/mpt/MerklePatriciaTrieSuite.scala +++ b/src/test/scala/io/iohk/ethereum/mpt/MerklePatriciaTrieSuite.scala @@ -9,12 +9,12 @@ import io.iohk.ethereum.db.storage._ import io.iohk.ethereum.db.storage.pruning.BasicPruning import io.iohk.ethereum.mpt.MerklePatriciaTrie.{MPTException, defaultByteArraySerializable} import org.scalacheck.{Arbitrary, Gen} -import org.scalatest.FunSuite import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scala.util.{Random, Try} +import org.scalatest.funsuite.AnyFunSuite -class MerklePatriciaTrieSuite extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class MerklePatriciaTrieSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { val EmptyEphemNodeStorage = StateStorage.createTestStateStorage(EphemDataSource())._1.getBackingStorage(0) diff --git a/src/test/scala/io/iohk/ethereum/network/AsymmetricCipherKeyPairLoaderSpec.scala b/src/test/scala/io/iohk/ethereum/network/AsymmetricCipherKeyPairLoaderSpec.scala index 7dfbd2ad13..9bd526dd82 100644 --- a/src/test/scala/io/iohk/ethereum/network/AsymmetricCipherKeyPairLoaderSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/AsymmetricCipherKeyPairLoaderSpec.scala @@ -5,11 +5,12 @@ import java.nio.file.Files import io.iohk.ethereum.network import io.iohk.ethereum.nodebuilder.SecureRandomBuilder -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.crypto.params.{ECPrivateKeyParameters, ECPublicKeyParameters} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class AsymmetricCipherKeyPairLoaderSpec extends FlatSpec with Matchers with SecureRandomBuilder { +class AsymmetricCipherKeyPairLoaderSpec extends AnyFlatSpec with Matchers with SecureRandomBuilder { def withFilePath(testCode: String => Any): Unit = { val path = Files.createTempFile("key-", "").toAbsolutePath.toString diff --git a/src/test/scala/io/iohk/ethereum/network/AuthHandshakerSpec.scala b/src/test/scala/io/iohk/ethereum/network/AuthHandshakerSpec.scala index ab9bd97dfe..030458ff4d 100644 --- a/src/test/scala/io/iohk/ethereum/network/AuthHandshakerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/AuthHandshakerSpec.scala @@ -7,12 +7,13 @@ import akka.util.ByteString import io.iohk.ethereum.crypto._ import io.iohk.ethereum.network.rlpx.{AuthHandshakeSuccess, AuthHandshaker, AuthResponseMessage, Secrets} import io.iohk.ethereum.nodebuilder.SecureRandomBuilder -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.params.{ECPrivateKeyParameters, ECPublicKeyParameters} import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class AuthHandshakerSpec extends FlatSpec with Matchers with SecureRandomBuilder { +class AuthHandshakerSpec extends AnyFlatSpec with Matchers with SecureRandomBuilder { val remoteNodeKey = new AsymmetricCipherKeyPair( new ECPublicKeyParameters(curve.getCurve.decodePoint( diff --git a/src/test/scala/io/iohk/ethereum/network/AuthInitiateMessageSpec.scala b/src/test/scala/io/iohk/ethereum/network/AuthInitiateMessageSpec.scala index 3b21245e4f..d9e3f55ae8 100644 --- a/src/test/scala/io/iohk/ethereum/network/AuthInitiateMessageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/AuthInitiateMessageSpec.scala @@ -5,12 +5,13 @@ import io.iohk.ethereum.crypto._ import io.iohk.ethereum.network.rlpx.{AuthHandshaker, AuthInitiateMessage} import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils.ByteUtils -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.generators.ECKeyPairGenerator import org.bouncycastle.crypto.params.{ECKeyGenerationParameters, ECPublicKeyParameters} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class AuthInitiateMessageSpec extends FlatSpec with Matchers with SecureRandomBuilder { +class AuthInitiateMessageSpec extends AnyFlatSpec with Matchers with SecureRandomBuilder { "AuthInitiateMessage" should "encode and decode itself" in { val keyPair = { diff --git a/src/test/scala/io/iohk/ethereum/network/EtcPeerManagerSpec.scala b/src/test/scala/io/iohk/ethereum/network/EtcPeerManagerSpec.scala index 7349eeeeac..54ad27ffbe 100644 --- a/src/test/scala/io/iohk/ethereum/network/EtcPeerManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/EtcPeerManagerSpec.scala @@ -20,9 +20,10 @@ import io.iohk.ethereum.network.p2p.messages.Versions import io.iohk.ethereum.network.p2p.messages.WireProtocol.Disconnect import io.iohk.ethereum.utils.Config import org.bouncycastle.util.encoders.Hex -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class EtcPeerManagerSpec extends FlatSpec with Matchers { +class EtcPeerManagerSpec extends AnyFlatSpec with Matchers { it should "start with the peers initial info as provided" in new TestSetup { peerEventBus.expectMsg(Subscribe(PeerHandshaked)) diff --git a/src/test/scala/io/iohk/ethereum/network/KnownNodesManagerSpec.scala b/src/test/scala/io/iohk/ethereum/network/KnownNodesManagerSpec.scala index 50296a2a4c..95a516c924 100644 --- a/src/test/scala/io/iohk/ethereum/network/KnownNodesManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/KnownNodesManagerSpec.scala @@ -9,9 +9,10 @@ import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup import io.iohk.ethereum.network.KnownNodesManager.KnownNodesManagerConfig import scala.concurrent.duration._ -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class KnownNodesManagerSpec extends FlatSpec with Matchers { +class KnownNodesManagerSpec extends AnyFlatSpec with Matchers { "KnownNodesManager" should "keep a list of nodes and persist changes" in new TestSetup { knownNodesManager.tell(KnownNodesManager.GetKnownNodes, client.ref) diff --git a/src/test/scala/io/iohk/ethereum/network/NodeParserSpec.scala b/src/test/scala/io/iohk/ethereum/network/NodeParserSpec.scala index 2609549961..1ab3142a8f 100644 --- a/src/test/scala/io/iohk/ethereum/network/NodeParserSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/NodeParserSpec.scala @@ -1,10 +1,11 @@ package io.iohk.ethereum.network import io.iohk.ethereum.network.discovery.NodeParser -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class NodeParserSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class NodeParserSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { it should "correctly parse IPv4 nodes" in { val testVectors = Table[String, Boolean, Boolean]( diff --git a/src/test/scala/io/iohk/ethereum/network/PeerActorHandshakingSpec.scala b/src/test/scala/io/iohk/ethereum/network/PeerActorHandshakingSpec.scala index 2f525ab90d..4ad723ea97 100644 --- a/src/test/scala/io/iohk/ethereum/network/PeerActorHandshakingSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/PeerActorHandshakingSpec.scala @@ -20,9 +20,10 @@ import io.iohk.ethereum.network.p2p.messages.Versions import io.iohk.ethereum.network.p2p.messages.WireProtocol.{Disconnect, Hello, Pong} import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler import io.iohk.ethereum.utils.Config -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PeerActorHandshakingSpec extends FlatSpec with Matchers { +class PeerActorHandshakingSpec extends AnyFlatSpec with Matchers { it should "succeed in establishing connection if the handshake is always successful" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/network/PeerEventBusActorSpec.scala b/src/test/scala/io/iohk/ethereum/network/PeerEventBusActorSpec.scala index 45f2deb110..7c509f581b 100644 --- a/src/test/scala/io/iohk/ethereum/network/PeerEventBusActorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/PeerEventBusActorSpec.scala @@ -12,9 +12,10 @@ import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo import io.iohk.ethereum.network.p2p.messages.CommonMessages.Status import io.iohk.ethereum.network.p2p.messages.Versions import io.iohk.ethereum.network.p2p.messages.WireProtocol.{Ping, Pong} -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PeerEventBusActorSpec extends FlatSpec with Matchers { +class PeerEventBusActorSpec extends AnyFlatSpec with Matchers { "PeerEventBusActor" should "relay messages received to subscribers" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/network/PeerManagerSpec.scala b/src/test/scala/io/iohk/ethereum/network/PeerManagerSpec.scala index 1123ae48c2..9beb3d6947 100644 --- a/src/test/scala/io/iohk/ethereum/network/PeerManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/PeerManagerSpec.scala @@ -19,10 +19,11 @@ import io.iohk.ethereum.network.p2p.messages.WireProtocol.Disconnect import io.iohk.ethereum.utils.Config import io.iohk.ethereum.{Fixtures, NormalPatience} import org.scalatest.concurrent.Eventually -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers // scalastyle:off magic.number -class PeerManagerSpec extends FlatSpec with Matchers with Eventually with NormalPatience { +class PeerManagerSpec extends AnyFlatSpec with Matchers with Eventually with NormalPatience { "PeerManager" should "try to connect to bootstrap and known nodes on startup" in new TestSetup { startConnecting() diff --git a/src/test/scala/io/iohk/ethereum/network/discovery/PeerDiscoveryManagerSpec.scala b/src/test/scala/io/iohk/ethereum/network/discovery/PeerDiscoveryManagerSpec.scala index 5e84272771..4b7c6207fd 100644 --- a/src/test/scala/io/iohk/ethereum/network/discovery/PeerDiscoveryManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/discovery/PeerDiscoveryManagerSpec.scala @@ -16,10 +16,11 @@ import io.iohk.ethereum.utils.{Config, NodeStatus, ServerStatus} import java.util.concurrent.atomic.AtomicReference import org.scalamock.scalatest.MockFactory import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpec, Matchers} import scala.util.Success +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PeerDiscoveryManagerSpec extends FlatSpec with Matchers with MockFactory with ScalaFutures with NormalPatience { +class PeerDiscoveryManagerSpec extends AnyFlatSpec with Matchers with MockFactory with ScalaFutures with NormalPatience { it should "correctly respond to Ping Message" in new TestSetup { val pingMessageReceived = MessageReceived(ping, remoteUdpAddress, pingPingPacketDecoded) diff --git a/src/test/scala/io/iohk/ethereum/network/handshaker/EtcHandshakerSpec.scala b/src/test/scala/io/iohk/ethereum/network/handshaker/EtcHandshakerSpec.scala index f980e22288..b4e20de794 100644 --- a/src/test/scala/io/iohk/ethereum/network/handshaker/EtcHandshakerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/handshaker/EtcHandshakerSpec.scala @@ -20,9 +20,10 @@ import io.iohk.ethereum.network.p2p.messages.WireProtocol.{Capability, Disconnec import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils._ import java.util.concurrent.atomic.AtomicReference -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class EtcHandshakerSpec extends FlatSpec with Matchers { +class EtcHandshakerSpec extends AnyFlatSpec with Matchers { it should "correctly connect during an apropiate handshake if no fork resolver is used" in new TestSetup with LocalPeerSetup with RemotePeerSetup { diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/FrameCodecSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/FrameCodecSpec.scala index eeb260db61..b6faf27d43 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/FrameCodecSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/FrameCodecSpec.scala @@ -5,9 +5,10 @@ import io.iohk.ethereum.rlp.RLPImplicitConversions._ import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.network.rlpx.{Frame, FrameCodec, Header} import io.iohk.ethereum.rlp.{RLPEncodeable, RLPList, RLPSerializable, rawDecode} -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class FrameCodecSpec extends FlatSpec with Matchers { +class FrameCodecSpec extends AnyFlatSpec with Matchers { import DummyMsg._ diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/MessageCodecSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/MessageCodecSpec.scala index a55b54da17..b196fabc15 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/MessageCodecSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/MessageCodecSpec.scala @@ -7,9 +7,10 @@ import io.iohk.ethereum.network.p2p.messages.Versions import io.iohk.ethereum.network.p2p.messages.WireProtocol.{Capability, Hello} import io.iohk.ethereum.network.rlpx.{FrameCodec, MessageCodec} import io.iohk.ethereum.utils.Config -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class MessageCodecSpec extends FlatSpec with Matchers { +class MessageCodecSpec extends AnyFlatSpec with Matchers { it should "not compress messages when remote side advertises p2p version less than 5" in new TestSetup { val remoteHello = remoteMessageCodec.encodeMessage(helloV4) diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/MessageSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/MessageSpec.scala index 4901b796cc..3db64ad098 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/MessageSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/MessageSpec.scala @@ -2,10 +2,11 @@ package io.iohk.ethereum.network.p2p import akka.util.ByteString import io.iohk.ethereum.network.p2p.messages._ -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class MessageSpec extends FlatSpec with Matchers { +class MessageSpec extends AnyFlatSpec with Matchers { val decode = EthereumMessageDecoder.fromBytes _ diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/PeerActorSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/PeerActorSpec.scala index ff46ea821c..6218c93f20 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/PeerActorSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/PeerActorSpec.scala @@ -34,12 +34,13 @@ import io.iohk.ethereum.{Fixtures, Mocks, Timeouts, crypto} import org.bouncycastle.crypto.AsymmetricCipherKeyPair import org.bouncycastle.crypto.params.ECPublicKeyParameters import org.bouncycastle.util.encoders.Hex -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration._ import scala.language.postfixOps +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PeerActorSpec extends FlatSpec with Matchers { +class PeerActorSpec extends AnyFlatSpec with Matchers { val remoteNodeKey: AsymmetricCipherKeyPair = generateKeyPair(new SecureRandom) val remoteNodeId: ByteString = ByteString(remoteNodeKey.getPublic.asInstanceOf[ECPublicKeyParameters].toNodeId) diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/messages/MessagesSerializationSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/messages/MessagesSerializationSpec.scala index 5d62df76e6..442974aba0 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/messages/MessagesSerializationSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/messages/MessagesSerializationSpec.scala @@ -7,10 +7,11 @@ import io.iohk.ethereum.network.p2p.messages.CommonMessages.{NewBlock, SignedTra import io.iohk.ethereum.network.p2p.messages.PV61.BlockHashesFromNumber import io.iohk.ethereum.network.p2p.messages.PV62._ import io.iohk.ethereum.network.p2p.messages.WireProtocol._ -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MessagesSerializationSpec extends WordSpec with ScalaCheckPropertyChecks with Matchers { +class MessagesSerializationSpec extends AnyWordSpec with ScalaCheckPropertyChecks with Matchers { "Wire Protocol" when { diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/messages/NewBlockSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/messages/NewBlockSpec.scala index 2e056703dd..fa57bc9e9c 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/messages/NewBlockSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/messages/NewBlockSpec.scala @@ -4,13 +4,13 @@ import akka.util.ByteString import io.iohk.ethereum.ObjectGenerators import io.iohk.ethereum.domain.{Block, BlockBody, BlockHeader} import io.iohk.ethereum.network.p2p.messages.CommonMessages.NewBlock -import org.scalatest.FunSuite import org.bouncycastle.util.encoders.Hex import NewBlock._ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class NewBlockSpec extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators with SecureRandomBuilder { +class NewBlockSpec extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators with SecureRandomBuilder { val chainId = Hex.decode("3d").head diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/messages/NodeDataSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/messages/NodeDataSpec.scala index 845ae0156d..acf0d70168 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/messages/NodeDataSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/messages/NodeDataSpec.scala @@ -10,11 +10,12 @@ import io.iohk.ethereum.network.p2p.messages.PV63.MptNodeEncoders._ import io.iohk.ethereum.rlp.RLPImplicitConversions._ import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.rlp.{encode, _} -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.util.encoders.Hex import io.iohk.ethereum.network.p2p.EthereumMessageDecoder +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class NodeDataSpec extends FlatSpec with Matchers { +class NodeDataSpec extends AnyFlatSpec with Matchers { import AccountImplicits._ diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/messages/ReceiptsSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/messages/ReceiptsSpec.scala index 997e647cf2..02adb40d3d 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/messages/ReceiptsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/messages/ReceiptsSpec.scala @@ -9,9 +9,10 @@ import io.iohk.ethereum.rlp.RLPImplicitConversions._ import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.rlp._ import org.bouncycastle.util.encoders.Hex -import org.scalatest.{ FlatSpec, Matchers } +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ReceiptsSpec extends FlatSpec with Matchers { +class ReceiptsSpec extends AnyFlatSpec with Matchers { val exampleHash = ByteString(kec256((0 until 32).map(_ => 1: Byte).toArray)) val exampleLogsBloom = ByteString((0 until 256).map(_ => 1: Byte).toArray) diff --git a/src/test/scala/io/iohk/ethereum/network/p2p/messages/TransactionSpec.scala b/src/test/scala/io/iohk/ethereum/network/p2p/messages/TransactionSpec.scala index f870d04875..ff3dd0e7c6 100644 --- a/src/test/scala/io/iohk/ethereum/network/p2p/messages/TransactionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/p2p/messages/TransactionSpec.scala @@ -6,9 +6,10 @@ import io.iohk.ethereum.domain.{Address, SignedTransaction, Transaction} import io.iohk.ethereum.utils.Config import org.bouncycastle.math.ec.ECPoint import org.bouncycastle.util.encoders.Hex -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class TransactionSpec extends FlatSpec with Matchers { +class TransactionSpec extends AnyFlatSpec with Matchers { val blockchainConfig = Config.blockchains.blockchainConfig diff --git a/src/test/scala/io/iohk/ethereum/network/rlpx/MessageCompressionSpec.scala b/src/test/scala/io/iohk/ethereum/network/rlpx/MessageCompressionSpec.scala index 88d5a63889..e7946772df 100644 --- a/src/test/scala/io/iohk/ethereum/network/rlpx/MessageCompressionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/rlpx/MessageCompressionSpec.scala @@ -3,13 +3,14 @@ package io.iohk.ethereum.network.rlpx import akka.util.ByteString import org.bouncycastle.util.encoders.Hex import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import org.xerial.snappy.Snappy import io.iohk.ethereum.domain.Block._ import scala.io.Source +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class MessageCompressionSpec extends FlatSpec with Matchers with MockFactory { +class MessageCompressionSpec extends AnyFlatSpec with Matchers with MockFactory { it should "decode block compressed by go" in { val testURL = getClass.getResource("/block.go.snappy") diff --git a/src/test/scala/io/iohk/ethereum/network/rlpx/RLPxConnectionHandlerSpec.scala b/src/test/scala/io/iohk/ethereum/network/rlpx/RLPxConnectionHandlerSpec.scala index 2576576f01..3c54c4db02 100644 --- a/src/test/scala/io/iohk/ethereum/network/rlpx/RLPxConnectionHandlerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/network/rlpx/RLPxConnectionHandlerSpec.scala @@ -14,11 +14,12 @@ import io.iohk.ethereum.network.p2p.messages.WireProtocol.Ping import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} import scala.concurrent.duration.FiniteDuration +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class RLPxConnectionHandlerSpec extends FlatSpec with Matchers with MockFactory { +class RLPxConnectionHandlerSpec extends AnyFlatSpec with Matchers with MockFactory { it should "write messages send to TCP connection" in new TestSetup { diff --git a/src/test/scala/io/iohk/ethereum/ommers/OmmersPoolSpec.scala b/src/test/scala/io/iohk/ethereum/ommers/OmmersPoolSpec.scala index 7f91899aed..9605d2a3c0 100644 --- a/src/test/scala/io/iohk/ethereum/ommers/OmmersPoolSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ommers/OmmersPoolSpec.scala @@ -7,9 +7,10 @@ import io.iohk.ethereum.Timeouts import io.iohk.ethereum.domain.BlockchainImpl import io.iohk.ethereum.ommers.OmmersPool.{AddOmmers, GetOmmers, RemoveOmmers} import org.scalamock.scalatest.MockFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class OmmersPoolSpec extends FlatSpec with Matchers with MockFactory { +class OmmersPoolSpec extends AnyFlatSpec with Matchers with MockFactory { "OmmersPool" should "accept ommers" in new TestSetup { //just return header diff --git a/src/test/scala/io/iohk/ethereum/rlp/RLPSuite.scala b/src/test/scala/io/iohk/ethereum/rlp/RLPSuite.scala index b1c831279f..d8e0efc031 100644 --- a/src/test/scala/io/iohk/ethereum/rlp/RLPSuite.scala +++ b/src/test/scala/io/iohk/ethereum/rlp/RLPSuite.scala @@ -5,13 +5,13 @@ import io.iohk.ethereum.rlp.RLPImplicitConversions._ import io.iohk.ethereum.rlp.RLPImplicits._ import io.iohk.ethereum.utils.Logger import org.scalacheck.{Arbitrary, Gen} -import org.scalatest.FunSuite import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.{ScalaCheckDrivenPropertyChecks, ScalaCheckPropertyChecks} import scala.language.implicitConversions import scala.util.Try +import org.scalatest.funsuite.AnyFunSuite -class RLPSuite extends FunSuite with ScalaCheckPropertyChecks with ScalaCheckDrivenPropertyChecks with Logger { +class RLPSuite extends AnyFunSuite with ScalaCheckPropertyChecks with ScalaCheckDrivenPropertyChecks with Logger { test("nextElementIndex of empty data") { val maybeIndex = Try { nextElementIndex(Array.emptyByteArray, 0) } diff --git a/src/test/scala/io/iohk/ethereum/transactions/PendingTransactionsManagerSpec.scala b/src/test/scala/io/iohk/ethereum/transactions/PendingTransactionsManagerSpec.scala index c8f9e9b916..2ef5000898 100644 --- a/src/test/scala/io/iohk/ethereum/transactions/PendingTransactionsManagerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/transactions/PendingTransactionsManagerSpec.scala @@ -19,12 +19,13 @@ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.transactions.SignedTransactionsFilterActor.ProperSignedTransactions import io.iohk.ethereum.utils.TxPoolConfig import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{FlatSpec, Matchers} import org.bouncycastle.crypto.AsymmetricCipherKeyPair import scala.concurrent.duration._ +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class PendingTransactionsManagerSpec extends FlatSpec with Matchers with ScalaFutures with NormalPatience { +class PendingTransactionsManagerSpec extends AnyFlatSpec with Matchers with ScalaFutures with NormalPatience { "PendingTransactionsManager" should "store pending transactions received from peers" in new TestSetup { val msg = ((1 to 10).map(e => newStx(e))).toSet diff --git a/src/test/scala/io/iohk/ethereum/utils/ByteUtilsSpec.scala b/src/test/scala/io/iohk/ethereum/utils/ByteUtilsSpec.scala index c3aa66ecb6..24fe7b89e4 100644 --- a/src/test/scala/io/iohk/ethereum/utils/ByteUtilsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/utils/ByteUtilsSpec.scala @@ -1,10 +1,10 @@ package io.iohk.ethereum.utils import io.iohk.ethereum.ObjectGenerators -import org.scalatest.FunSuite import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite -class ByteUtilsSpec extends FunSuite with ScalaCheckPropertyChecks with ObjectGenerators { +class ByteUtilsSpec extends AnyFunSuite with ScalaCheckPropertyChecks with ObjectGenerators { test("Convert Bytes to Int in little endian") { forAll(byteArrayOfNItemsGen(32)) { bytes => val toInts = ByteUtils.bytesToInts(bytes, bigEndian = false) diff --git a/src/test/scala/io/iohk/ethereum/utils/ConfigUtilsSpec.scala b/src/test/scala/io/iohk/ethereum/utils/ConfigUtilsSpec.scala index 4639bbd09d..13ec77db5a 100644 --- a/src/test/scala/io/iohk/ethereum/utils/ConfigUtilsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/utils/ConfigUtilsSpec.scala @@ -1,9 +1,10 @@ package io.iohk.ethereum.utils import com.typesafe.config.ConfigFactory -import org.scalatest.{Matchers, WordSpec} +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ConfigUtilsSpec extends WordSpec with Matchers { +class ConfigUtilsSpec extends AnyWordSpec with Matchers { "keys" should { "return top-level keys of given config instance" in { val config = ConfigFactory.parseString("""{ diff --git a/src/test/scala/io/iohk/ethereum/vm/BlakeCompressionSpec.scala b/src/test/scala/io/iohk/ethereum/vm/BlakeCompressionSpec.scala index f6ab40591c..b92d9bc0a4 100644 --- a/src/test/scala/io/iohk/ethereum/vm/BlakeCompressionSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/BlakeCompressionSpec.scala @@ -1,10 +1,11 @@ package io.iohk.ethereum.vm import org.bouncycastle.util.encoders.Hex -import org.scalatest.{FlatSpec, Matchers} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class BlakeCompressionSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class BlakeCompressionSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { // test vectors from: https://eips.ethereum.org/EIPS/eip-152 val testVectors = Table[String, Option[String]]( ("value", "result"), diff --git a/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpec.scala b/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpec.scala index 008aabe428..f2d9dbf74b 100644 --- a/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpec.scala @@ -5,13 +5,14 @@ import io.iohk.ethereum.crypto._ import io.iohk.ethereum.domain.{Account, Address, UInt256} import io.iohk.ethereum.utils.ByteUtils import io.iohk.ethereum.vm.MockWorldState._ -import org.scalatest.{Matchers, WordSpec} import Fixtures.blockchainConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off object.name // scalastyle:off file.size.limit -class CallOpcodesSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class CallOpcodesSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { val config = EvmConfig.ByzantiumConfigBuilder(blockchainConfig) val startState = MockWorldState(touchedAccounts = Set.empty) diff --git a/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpecPostEip161.scala b/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpecPostEip161.scala index ee986c0175..1f847d2ba1 100644 --- a/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpecPostEip161.scala +++ b/src/test/scala/io/iohk/ethereum/vm/CallOpcodesSpecPostEip161.scala @@ -2,12 +2,13 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.domain.{Address, UInt256} import io.iohk.ethereum.vm.MockWorldState._ -import org.scalatest.{Matchers, WordSpec} import Fixtures.blockchainConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off object.name -class CallOpcodesSpecPostEip161 extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class CallOpcodesSpecPostEip161 extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { val config = EvmConfig.PostEIP161ConfigBuilder(blockchainConfig) val startState = MockWorldState(touchedAccounts = Set.empty, noEmptyAccountsCond = true) diff --git a/src/test/scala/io/iohk/ethereum/vm/CreateOpcodeSpec.scala b/src/test/scala/io/iohk/ethereum/vm/CreateOpcodeSpec.scala index 1816e33e83..b6de953c9d 100644 --- a/src/test/scala/io/iohk/ethereum/vm/CreateOpcodeSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/CreateOpcodeSpec.scala @@ -2,16 +2,17 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.domain.{Account, Address, UInt256} import io.iohk.ethereum.Fixtures.{Blocks => BlockFixtures} -import org.scalatest.{Matchers, WordSpec} import MockWorldState._ import akka.util.ByteString import Fixtures.blockchainConfig import io.iohk.ethereum.crypto.kec256 import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off method.length -class CreateOpcodeSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class CreateOpcodeSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { val config = EvmConfig.ByzantiumConfigBuilder(blockchainConfig) diff --git a/src/test/scala/io/iohk/ethereum/vm/MemorySpec.scala b/src/test/scala/io/iohk/ethereum/vm/MemorySpec.scala index 5ff76fe47a..1a480901d8 100644 --- a/src/test/scala/io/iohk/ethereum/vm/MemorySpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/MemorySpec.scala @@ -2,12 +2,13 @@ package io.iohk.ethereum.vm import akka.util.ByteString import io.iohk.ethereum.vm.Generators._ -import org.scalatest.{FunSuite, Matchers} import org.scalacheck.{Arbitrary, Gen} import io.iohk.ethereum.domain.UInt256 import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class MemorySpec extends FunSuite with ScalaCheckPropertyChecks with Matchers { +class MemorySpec extends AnyFunSuite with ScalaCheckPropertyChecks with Matchers { def zeros(size: Int): ByteString = { if (size <= 0) diff --git a/src/test/scala/io/iohk/ethereum/vm/OpCodeFunSpec.scala b/src/test/scala/io/iohk/ethereum/vm/OpCodeFunSpec.scala index 94065e20ad..d67107bb46 100644 --- a/src/test/scala/io/iohk/ethereum/vm/OpCodeFunSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/OpCodeFunSpec.scala @@ -6,11 +6,12 @@ import io.iohk.ethereum.domain.{Account, Address, TxLogEntry, UInt256} import io.iohk.ethereum.vm.Generators._ import io.iohk.ethereum.domain.UInt256._ import org.scalacheck.Gen -import org.scalatest.{FunSuite, Matchers} import Fixtures.blockchainConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class OpCodeFunSpec extends FunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { +class OpCodeFunSpec extends AnyFunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { import MockWorldState.PS diff --git a/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpec.scala b/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpec.scala index 4278bbd9b4..d237daa747 100644 --- a/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpec.scala @@ -3,12 +3,13 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.domain.UInt256._ import io.iohk.ethereum.domain.{Account, Address, UInt256} import io.iohk.ethereum.vm.Generators._ -import org.scalatest.{FunSuite, Matchers} import Fixtures.blockchainConfig import org.scalacheck.Gen import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class OpCodeGasSpec extends FunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { +class OpCodeGasSpec extends AnyFunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { override val config = EvmConfig.PhoenixConfigBuilder(blockchainConfig) diff --git a/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpecPostEip161.scala b/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpecPostEip161.scala index 770c8ed269..c62cc63b26 100644 --- a/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpecPostEip161.scala +++ b/src/test/scala/io/iohk/ethereum/vm/OpCodeGasSpecPostEip161.scala @@ -3,11 +3,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.domain.UInt256._ import io.iohk.ethereum.domain.{Account, Address} import io.iohk.ethereum.vm.Generators._ -import org.scalatest.{FunSuite, Matchers} import Fixtures.blockchainConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class OpCodeGasSpecPostEip161 extends FunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { +class OpCodeGasSpecPostEip161 extends AnyFunSuite with OpCodeTesting with Matchers with ScalaCheckPropertyChecks { override val config = EvmConfig.PostEIP161ConfigBuilder(blockchainConfig) diff --git a/src/test/scala/io/iohk/ethereum/vm/OpCodeTesting.scala b/src/test/scala/io/iohk/ethereum/vm/OpCodeTesting.scala index 3aaac86bb0..c895730425 100644 --- a/src/test/scala/io/iohk/ethereum/vm/OpCodeTesting.scala +++ b/src/test/scala/io/iohk/ethereum/vm/OpCodeTesting.scala @@ -1,11 +1,11 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.MockWorldState.PS -import org.scalatest.{FunSuiteLike, Matchers} +import org.scalatest.funsuite.AnyFunSuiteLike +import org.scalatest.matchers.should.Matchers - -trait OpCodeTesting extends FunSuiteLike { - matchers: Matchers => +trait OpCodeTesting extends AnyFunSuiteLike { + matchers: Matchers => val config: EvmConfig @@ -50,7 +50,7 @@ trait OpCodeTesting extends FunSuiteLike { case RevertOccurs => () case ReturnDataOverflow => () }.isEmpty - ){ + ) { //Found error that is neither an InvalidJump nor RevertOccurs fail(s"Unexpected ${stateOut.error.get} error") } else { diff --git a/src/test/scala/io/iohk/ethereum/vm/PrecompiledContractsSpec.scala b/src/test/scala/io/iohk/ethereum/vm/PrecompiledContractsSpec.scala index e801453425..41ffec1cd7 100644 --- a/src/test/scala/io/iohk/ethereum/vm/PrecompiledContractsSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/PrecompiledContractsSpec.scala @@ -4,15 +4,16 @@ import akka.util.ByteString import io.iohk.ethereum.crypto._ import io.iohk.ethereum.domain.{Account, Address, UInt256} import io.iohk.ethereum.Fixtures.{Blocks => BlockFixtures} -import org.scalatest.{FunSuite, Matchers} import MockWorldState._ import io.iohk.ethereum.nodebuilder.SecureRandomBuilder import io.iohk.ethereum.utils.ByteUtils import org.bouncycastle.util.encoders.Hex import Fixtures.blockchainConfig import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class PrecompiledContractsSpec extends FunSuite with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { +class PrecompiledContractsSpec extends AnyFunSuite with Matchers with ScalaCheckPropertyChecks with SecureRandomBuilder { val vm = new TestVM diff --git a/src/test/scala/io/iohk/ethereum/vm/ProgramSpec.scala b/src/test/scala/io/iohk/ethereum/vm/ProgramSpec.scala index 46922790f1..1668d8bd9b 100644 --- a/src/test/scala/io/iohk/ethereum/vm/ProgramSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/ProgramSpec.scala @@ -1,12 +1,13 @@ package io.iohk.ethereum.vm -import org.scalatest.{FlatSpec, Matchers} import Generators._ import akka.util.ByteString import org.scalacheck.Gen import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ProgramSpec extends FlatSpec with Matchers with ScalaCheckPropertyChecks { +class ProgramSpec extends AnyFlatSpec with Matchers with ScalaCheckPropertyChecks { val CodeSize = Byte.MaxValue val PositionsSize = 10 diff --git a/src/test/scala/io/iohk/ethereum/vm/SSTOREOpCodeGasPostConstantinopleSpec.scala b/src/test/scala/io/iohk/ethereum/vm/SSTOREOpCodeGasPostConstantinopleSpec.scala index 75be385f6d..a30baab582 100644 --- a/src/test/scala/io/iohk/ethereum/vm/SSTOREOpCodeGasPostConstantinopleSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/SSTOREOpCodeGasPostConstantinopleSpec.scala @@ -5,13 +5,14 @@ import io.iohk.ethereum.domain.{Account, Address, BlockHeader} import io.iohk.ethereum.Fixtures.{Blocks => BlockFixtures} import io.iohk.ethereum.vm.Fixtures.blockchainConfig import io.iohk.ethereum.vm.MockWorldState.{PC, TestVM} -import org.scalatest.{Matchers, WordSpec} import akka.util.ByteString.{empty => bEmpty} import io.iohk.ethereum.crypto.kec256 import org.bouncycastle.util.encoders.Hex import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class StoreOpCodeGasPostConstantinopleSpec extends WordSpec with ScalaCheckPropertyChecks with Matchers with TestSetup { +class StoreOpCodeGasPostConstantinopleSpec extends AnyWordSpec with ScalaCheckPropertyChecks with Matchers with TestSetup { val defaultGaspool = 1000000 diff --git a/src/test/scala/io/iohk/ethereum/vm/ShiftingOpCodeSpec.scala b/src/test/scala/io/iohk/ethereum/vm/ShiftingOpCodeSpec.scala index 42eddd1432..28d53ca897 100644 --- a/src/test/scala/io/iohk/ethereum/vm/ShiftingOpCodeSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/ShiftingOpCodeSpec.scala @@ -9,11 +9,12 @@ import io.iohk.ethereum.vm.Fixtures.blockchainConfig import io.iohk.ethereum.vm.MockWorldState.{PC, TestVM} import org.bouncycastle.util.encoders.Hex import org.scalatest.prop.TableFor5 -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off magic.number -class ShiftingOpCodeSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class ShiftingOpCodeSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { val array_0x01 = Array(1.toByte) val array_0x00 = Array(0.toByte) diff --git a/src/test/scala/io/iohk/ethereum/vm/StackSpec.scala b/src/test/scala/io/iohk/ethereum/vm/StackSpec.scala index 9edbd585e5..982280c896 100644 --- a/src/test/scala/io/iohk/ethereum/vm/StackSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/StackSpec.scala @@ -1,11 +1,12 @@ package io.iohk.ethereum.vm import org.scalacheck.Gen -import org.scalatest.{FunSuite, Matchers} import io.iohk.ethereum.domain.UInt256 import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers -class StackSpec extends FunSuite with Matchers with ScalaCheckPropertyChecks { +class StackSpec extends AnyFunSuite with Matchers with ScalaCheckPropertyChecks { val maxStackSize = 32 val stackGen = Generators.getStackGen(maxSize = maxStackSize) diff --git a/src/test/scala/io/iohk/ethereum/vm/StaticCallOpcodeSpec.scala b/src/test/scala/io/iohk/ethereum/vm/StaticCallOpcodeSpec.scala index 6d62ea7539..afacff71d8 100644 --- a/src/test/scala/io/iohk/ethereum/vm/StaticCallOpcodeSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/StaticCallOpcodeSpec.scala @@ -2,11 +2,12 @@ package io.iohk.ethereum.vm import io.iohk.ethereum.vm.Fixtures.blockchainConfig import io.iohk.ethereum.vm.MockWorldState._ -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec // scalastyle:off object.name -class StaticCallOpcodeSpec extends WordSpec with Matchers with ScalaCheckPropertyChecks { +class StaticCallOpcodeSpec extends AnyWordSpec with Matchers with ScalaCheckPropertyChecks { val config = EvmConfig.ByzantiumConfigBuilder(blockchainConfig) val startState = MockWorldState(touchedAccounts = Set.empty, noEmptyAccountsCond = true) diff --git a/src/test/scala/io/iohk/ethereum/vm/VMSpec.scala b/src/test/scala/io/iohk/ethereum/vm/VMSpec.scala index 6d33ac71fe..9de5b3593a 100644 --- a/src/test/scala/io/iohk/ethereum/vm/VMSpec.scala +++ b/src/test/scala/io/iohk/ethereum/vm/VMSpec.scala @@ -5,10 +5,11 @@ import akka.util.ByteString.{empty => bEmpty} import io.iohk.ethereum.domain._ import io.iohk.ethereum.Fixtures.{Blocks => BlockFixtures} import io.iohk.ethereum.vm.MockWorldState._ -import org.scalatest.{Matchers, WordSpec} import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class VMSpec extends WordSpec with ScalaCheckPropertyChecks with Matchers { +class VMSpec extends AnyWordSpec with ScalaCheckPropertyChecks with Matchers { "VM" when {