Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into add-dcos-retroactively
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Nov 19, 2020
2 parents b0a0f34 + b8f1c5f commit 5067f2d
Show file tree
Hide file tree
Showing 47 changed files with 246 additions and 216 deletions.
17 changes: 9 additions & 8 deletions build.sbt
Expand Up @@ -3,7 +3,7 @@ import scala.util.Try
name := "scorex-core"

lazy val commonSettings = Seq(
scalaVersion := "2.12.10",
scalaVersion := "2.12.12",
resolvers += Resolver.sonatypeRepo("public"),
resolvers += "Maven Central Server" at "https://repo1.maven.org/maven2",
resolvers += "Typesafe Server" at "https://repo.typesafe.com/typesafe/releases",
Expand Down Expand Up @@ -72,9 +72,9 @@ version in ThisBuild := {

git.gitUncommittedChanges in ThisBuild := true

val circeVersion = "0.9.0"
val akkaVersion = "2.5.24"
val akkaHttpVersion = "10.1.9"
val circeVersion = "0.13.0"
val akkaVersion = "2.6.10"
val akkaHttpVersion = "10.2.1"

val networkDependencies = Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
Expand All @@ -98,20 +98,21 @@ val loggingDependencies = Seq(
"ch.qos.logback" % "logback-classic" % "1.3.0-alpha4"
)

val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.1.6"
val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.1.8"

val testingDependencies = Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test",
"org.scalactic" %% "scalactic" % "3.0.3" % "test",
"org.scalatest" %% "scalatest" % "3.0.3" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.+",
"org.scalatest" %% "scalatest" % "3.1.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.+",
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test,
scorexUtil, (scorexUtil % Test).classifier("tests")
)

libraryDependencies ++= Seq(
"com.iheart" %% "ficus" % "1.4.2",
"org.scorexfoundation" %% "scrypto" % "2.1.7",
"org.scorexfoundation" %% "scrypto" % "2.1.10",
scorexUtil
) ++ networkDependencies ++ apiDependencies ++ loggingDependencies ++ testingDependencies

Expand Down
7 changes: 4 additions & 3 deletions examples/build.sbt
Expand Up @@ -2,10 +2,11 @@ name := "scorex-examples"

libraryDependencies ++= Seq(
"org.scalactic" %% "scalactic" % "3.0.1" % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.+" % "test",
"org.scalatest" %% "scalatest" % "3.1.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.+" % "test",
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test,
"org.scorexfoundation" %% "iodb" % "0.3.2",
"com.typesafe.akka" %% "akka-testkit" % "2.4.17" % "test"
"com.typesafe.akka" %% "akka-testkit" % "2.6.10" % "test"
)

mainClass in assembly := Some("examples.hybrid.HybridApp")
Expand Down
Expand Up @@ -3,17 +3,17 @@ package hybrid.history
import examples.hybrid.history.{HybridHistory, HybridSyncInfo}
import hybrid.HybridGenerators
import org.scalacheck.Gen
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import scorex.core.consensus.History.{Equal, HistoryComparisonResult, Older, Younger}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.consensus.History.{Older, HistoryComparisonResult, Equal, Younger}
import scorex.core.utils.ScorexEncoding
import scorex.core.ModifierTypeId
import scorex.util.ModifierId

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps", "org.wartremover.warts.OptionPartial"))
class HybridHistorySpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class HybridHistorySpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators
with ScorexEncoding {
Expand Down
Expand Up @@ -5,15 +5,16 @@ import examples.hybrid.blocks.{HybridBlock, PosBlock, PowBlock}
import hybrid.HybridGenerators
import io.iohk.iodb.{ByteArrayWrapper, LSMStore}
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, Outcome, fixture}
import org.scalatest.matchers.should.Matchers
import org.scalatest.{fixture, Outcome}
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.utils.ScorexEncoding
import scorex.testkit.utils.FileUtils
import scorex.util.ModifierId

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
class IODBSpecification extends fixture.PropSpec
with GeneratorDrivenPropertyChecks
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators
with FileUtils
Expand Down
Expand Up @@ -2,14 +2,14 @@ package hybrid.primitives

import examples.commons.PublicKey25519NoncedBox
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.state.PrivateKey25519Companion

@SuppressWarnings(Array("org.wartremover.warts.OptionPartial"))
class PrivateKey25519Suite extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class PrivateKey25519Suite extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
Expand Up @@ -4,15 +4,15 @@ import examples.commons.{PublicKey25519NoncedBox, PublicKey25519NoncedBoxSeriali
import examples.hybrid.blocks.{PosBlock, PosBlockSerializer, PowBlock, PowBlockSerializer}
import examples.hybrid.history.{HybridSyncInfo, HybridSyncInfoSerializer}
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.box.proposition.PublicKey25519Proposition
import scorex.core.transaction.wallet.{WalletBox, WalletBoxSerializer}

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
class SerializationTests extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class SerializationTests extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
Expand Up @@ -3,15 +3,15 @@ package hybrid.state
import examples.hybrid.blocks.HybridBlock
import examples.hybrid.state.HBoxStoredState
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.state.{Insertion, Removal}
import scorex.testkit.properties.state.StateTests

@SuppressWarnings(Array("org.wartremover.warts.OptionPartial"))
class HBoxStoredStateSpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class HBoxStoredStateSpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators
with StateTests[HybridBlock, HBoxStoredState] {
Expand Down
Expand Up @@ -3,8 +3,9 @@ package hybrid.state
import examples.commons.{Nonce, PublicKey25519NoncedBox, SimpleBoxTransaction, Value}
import examples.hybrid.state.HBoxStoredState
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.box.proposition.PublicKey25519Proposition
import scorex.core.transaction.proof.{Signature25519, Signature25519Serializer}
import scorex.core.transaction.state.PrivateKey25519Companion
Expand All @@ -13,9 +14,8 @@ import scorex.crypto.hash.Sha256
import scorex.crypto.signatures.{PublicKey, Signature}

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
class SimpleBoxTransactionSpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class SimpleBoxTransactionSpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
Expand Up @@ -3,14 +3,14 @@ package hybrid.transaction
import examples.commons.SimpleBoxTransaction
import hybrid.HybridGenerators
import io.iohk.iodb.ByteArrayWrapper
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.state.PrivateKey25519Companion


class TransactionSuite extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class TransactionSuite extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
Expand Up @@ -2,14 +2,14 @@ package hybrid.validation

import examples.hybrid.validation.SemanticBlockValidator
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.crypto.hash.Blake2b256


class SemanticBlockValidatorSpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class SemanticBlockValidatorSpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
10 changes: 5 additions & 5 deletions examples/src/test/scala/hybrid/wallet/HWalletSpecification.scala
Expand Up @@ -4,8 +4,9 @@ import examples.commons.Value
import examples.hybrid.blocks.PosBlock
import examples.hybrid.wallet.HBoxWallet
import hybrid.HybridGenerators
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.bytesToId
import scorex.core.transaction.box.proposition.PublicKey25519Proposition
import scorex.core.transaction.proof.Signature25519
Expand All @@ -16,9 +17,8 @@ import scala.annotation.tailrec
import scala.util.Random

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
class HWalletSpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class HWalletSpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with HybridGenerators {

Expand Down
10 changes: 5 additions & 5 deletions examples/src/test/scala/spv/ChainTests.scala
Expand Up @@ -3,18 +3,18 @@ package spv
import examples.spv.simulation.SimulatorFuctions
import examples.spv.{Header, KLS16ProofSerializer, KMZProofSerializer, SpvAlgos}
import org.scalacheck.Gen
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.transaction.box.proposition.PublicKey25519Proposition
import scorex.core.transaction.state.{PrivateKey25519, PrivateKey25519Companion}
import scorex.crypto.hash
import scorex.crypto.hash.Blake2b256
import scorex.util.ModifierId

@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
class ChainTests extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class ChainTests extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with SPVGenerators
with SimulatorFuctions {
Expand Down
@@ -1,13 +1,13 @@
package spv.serialization

import examples.spv.{Header, HeaderSerializer}
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import spv.SPVGenerators

class SerializationTests extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class SerializationTests extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with SPVGenerators {

Expand Down
Expand Up @@ -2,13 +2,13 @@ package trimchain.serialization

import examples.trimchain.core.{Ticket, TicketSerializer}
import examples.trimchain.modifiers.{BlockHeader, BlockHeaderSerializer, TBlock, TBlockSerializer}
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import trimchain.TrimchainGenerators

class SerializationTests extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
class SerializationTests extends AnyPropSpec
with ScalaCheckPropertyChecks
with Matchers
with TrimchainGenerators {

Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/scorex/core/app/Application.scala
Expand Up @@ -5,7 +5,6 @@ import java.net.InetSocketAddress
import akka.actor.{ActorRef, ActorSystem}
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler, Route}
import akka.stream.ActorMaterializer
import scorex.core.api.http.{ApiErrorHandler, ApiRejectionHandler, ApiRoute, CompositeHttpService}
import scorex.core.network._
import scorex.core.network.message._
Expand Down Expand Up @@ -101,10 +100,9 @@ trait Application extends ScorexLogging {
log.debug(s"Max memory available: ${Runtime.getRuntime.maxMemory}")
log.debug(s"RPC is allowed at ${settings.restApi.bindAddress.toString}")

implicit val materializer: ActorMaterializer = ActorMaterializer()
val bindAddress = settings.restApi.bindAddress

Http().bindAndHandle(combinedRoute, bindAddress.getAddress.getHostAddress, bindAddress.getPort)
Http().newServerAt(bindAddress.getAddress.getHostAddress, bindAddress.getPort).bindFlow(combinedRoute)

//on unexpected shutdown
Runtime.getRuntime.addShutdownHook(new Thread() {
Expand Down

0 comments on commit 5067f2d

Please sign in to comment.