Skip to content

Commit cd863d2

Browse files
authored
Merge pull request #51 from input-output-hk/shared-components
Use ScorexLogging from the Scorex-util repository
2 parents a610ce2 + f372cc7 commit cd863d2

23 files changed

+50
-287
lines changed

build.sbt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ name := "scrypto"
44

55
lazy val commonSettings = Seq(
66
organization := "org.scorexfoundation",
7-
version := "2.1.3-SNAPSHOT",
7+
version := "2.1.3",
88
scalaVersion := "2.12.5",
9+
resolvers += Resolver.sonatypeRepo("public"),
910
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode")),
1011
homepage := Some(url("https://github.com/input-output-hk/scrypto")),
1112
pomExtra :=
@@ -28,7 +29,8 @@ libraryDependencies ++= Seq(
2829
"com.typesafe.scala-logging" %% "scala-logging" % "3.+",
2930
"ch.qos.logback" % "logback-classic" % "1.+",
3031
"org.whispersystems" % "curve25519-java" % "+",
31-
"org.bouncycastle" % "bcprov-jdk15on" % "1.+"
32+
"org.bouncycastle" % "bcprov-jdk15on" % "1.+",
33+
"org.scorexfoundation" %% "scorex-util" % "0.1.1-SNAPSHOT"
3234
)
3335

3436
libraryDependencies ++= Seq(

lock.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ dependencyOverrides in ThisBuild ++= Seq(
1010
"javax.activation" % "activation" % "1.1",
1111
"org.bouncycastle" % "bcprov-jdk15on" % "1.60",
1212
"org.rudogma" % "supertagged_2.12" % "1.4",
13+
"org.scorexfoundation" % "scorex-util_2.12" % "0.1.1-SNAPSHOT",
1314
"org.slf4j" % "slf4j-api" % "1.8.0-beta1",
1415
"org.whispersystems" % "curve25519-java" % "0.5.0"
1516
)
16-
// LIBRARY_DEPENDENCIES_HASH 6da534ddce5e26a47dc87a4777336311fe979572
17+
// LIBRARY_DEPENDENCIES_HASH 566ab37b6dd750a11f55c07c094f47be1499f752

release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
**2.1.3**
2+
---------
3+
4+
* Always explicit encoding in .getBytes String method
5+
* Base* and logging are moved to scorex-utils
6+
17
**2.1.2**
28
---------
39

src/main/scala/scorex/crypto/authds/TwoPartyProofElement.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scorex.crypto.authds
22

33
import scorex.crypto.authds.legacy.treap.Level
4-
import scorex.utils.{ScorexEncoding, ScryptoLogging}
4+
import scorex.utils.ScorexEncoding
55

66
trait TwoPartyProofElement extends ScorexEncoding {
77
val bytes: Array[Byte]

src/main/scala/scorex/crypto/authds/avltree/batch/BatchAVLProver.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package scorex.crypto.authds.avltree.batch
33
import com.google.common.primitives.Ints
44
import scorex.crypto.authds._
55
import scorex.crypto.hash.{Blake2b256, CryptographicHash, Digest}
6+
import scorex.util.ScorexLogging
67
import scorex.utils.ByteArray
78

89
import scala.annotation.tailrec
@@ -27,7 +28,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
2728
oldRootAndHeight: Option[(ProverNodes[D], Int)] = None,
2829
val collectChangedNodes: Boolean = true)
2930
(implicit val hf: HF = Blake2b256)
30-
extends AuthenticatedTreeOps[D] with ToStringHelper {
31+
extends AuthenticatedTreeOps[D] with ToStringHelper with ScorexLogging {
3132

3233
protected val labelLength = hf.DigestSize
3334

@@ -354,7 +355,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
354355
/**
355356
*
356357
* @param rand - source of randomness
357-
* @return Random leaf from the tree, that is not positive or negative infinity
358+
* @return Random leaf from the tree that is not positive or negative infinity
358359
*/
359360
def randomWalk(rand: Random = new Random): Option[(ADKey, ADValue)] = {
360361
def internalNodeFn(r: InternalProverNode[D], dummy: Unit.type) =

src/main/scala/scorex/crypto/authds/avltree/batch/Operation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scorex.crypto.authds.avltree.batch
22

33
import com.google.common.primitives.Longs
44
import scorex.crypto.authds.{ADKey, ADValue}
5-
import scorex.utils.{ScorexEncoding, ScryptoLogging}
5+
import scorex.utils.ScorexEncoding
66

77
import scala.util.{Failure, Success, Try}
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package scorex.crypto.authds.avltree.batch
22

3-
import scorex.utils.{ScorexEncoding, ScryptoLogging}
3+
import scorex.utils.ScorexEncoding
44

5-
trait ToStringHelper extends ScryptoLogging with ScorexEncoding {
5+
trait ToStringHelper extends ScorexEncoding {
66
//Needed for debug (toString) only
77
protected def arrayToString(a: Array[Byte]): String = encoder.encode(a).take(8)
88
}

src/main/scala/scorex/crypto/authds/merkle/MerkleProof.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scorex.crypto.authds.merkle
22

33
import scorex.crypto.authds.{LeafData, Side}
44
import scorex.crypto.hash.{CryptographicHash, Digest}
5-
import scorex.utils.{ScorexEncoding, ScryptoLogging}
5+
import scorex.utils.ScorexEncoding
66

77
/**
88
* Proof is given leaf data, leaf hash sibling and also siblings for parent nodes. Using this data, it is possible to

src/main/scala/scorex/crypto/authds/merkle/MerkleTree.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package scorex.crypto.authds.merkle
22

33
import scorex.crypto.authds.{LeafData, Side}
44
import scorex.crypto.hash._
5-
import scorex.utils.ScryptoLogging
65

76
import scala.annotation.tailrec
87
import scala.collection.mutable
@@ -64,7 +63,7 @@ case class MerkleTree[D <: Digest](topNode: Node[D],
6463
}
6564
}
6665

67-
object MerkleTree extends ScryptoLogging {
66+
object MerkleTree {
6867
val LeafPrefix: Byte = 0: Byte
6968
val InternalNodePrefix: Byte = 1: Byte
7069

src/main/scala/scorex/crypto/encode/Base16.scala

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)