Skip to content

Commit 93b0aa0

Browse files
dmitry-workerDmitry Voronov
authored andcommitted
Initial commit
1 parent a2a4a26 commit 93b0aa0

File tree

11 files changed

+988
-2885
lines changed

11 files changed

+988
-2885
lines changed

build.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
1414
name := projectName,
1515
organization := "io.iohk",
1616
version := "3.2.1",
17-
scalaVersion := "2.12.12",
17+
scalaVersion := "2.13.4",
1818
// Scalanet snapshots are published to Sonatype after each build.
1919
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
2020
testOptions in Test += Tests
@@ -24,10 +24,10 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
2424
"-deprecation",
2525
"-feature",
2626
"-Xfatal-warnings",
27-
"-Xlint:unsound-match",
28-
"-Ywarn-inaccessible",
29-
"-Ywarn-unused-import",
30-
"-Ypartial-unification",
27+
// "-Xlint:unsound-match",
28+
// "-Ywarn-inaccessible",
29+
// "-Ywarn-unused-import",
30+
// "-Ypartial-unification",
3131
"-encoding",
3232
"utf-8"
3333
),

bytes/src/main/scala/io/iohk/ethereum/utils/ByteUtils.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ object ByteUtils {
9797

9898
def padLeft(bytes: ByteString, length: Int, byte: Byte = 0): ByteString = {
9999
val l = math.max(0, length - bytes.length)
100-
val fill = Seq.fill[Byte](l)(byte)
101-
fill ++: bytes
100+
val fill = Array.fill[Byte](l)(byte)
101+
ByteString.apply(fill) ++ bytes
102102
}
103103

104104
def compactPickledBytesToArray(buffer: ByteBuffer): Array[Byte] = {
@@ -141,7 +141,7 @@ object ByteUtils {
141141
* @param bigEndian - param specifying which int representation should be used.
142142
* @return Unit
143143
*/
144-
def intsToBytesMut(arr: Array[Int], b: Array[Byte], bigEndian: Boolean) {
144+
def intsToBytesMut(arr: Array[Int], b: Array[Byte], bigEndian: Boolean): Unit = {
145145
if (!bigEndian) {
146146
var off = 0
147147
var i = 0
@@ -187,7 +187,7 @@ object ByteUtils {
187187
* @param bigEndian - param specifying which int representation should be used.
188188
* @return Unit
189189
*/
190-
def bytesToIntsMut(b: Array[Byte], arr: Array[Int], bigEndian: Boolean) {
190+
def bytesToIntsMut(b: Array[Byte], arr: Array[Int], bigEndian: Boolean): Unit = {
191191
if (!bigEndian) {
192192
var off = 0
193193
var i = 0

crypto/src/main/scala/io/iohk/ethereum/crypto/ECDSASignature.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ object ECDSASignature {
6464
case Some(id) if v == negativePointSign => (id * 2 + newNegativePointSign).toByte
6565
case Some(id) if v == positivePointSign => (id * 2 + newPositivePointSign).toByte
6666
case None => v
67+
case _ => throw new IllegalStateException("Cannot happen")
6768
}
6869

6970
ECDSASignature(r, s, pointSign)
@@ -176,6 +177,7 @@ case class ECDSASignature(r: BigInt, s: BigInt, v: Byte) {
176177
def bigInt2Bytes(b: BigInt) =
177178
ByteUtils.padLeft(ByteString(b.toByteArray).takeRight(RLength), RLength, 0)
178179

179-
bigInt2Bytes(r) ++ bigInt2Bytes(s) :+ v
180+
181+
bigInt2Bytes(r) ++ bigInt2Bytes(s) ++ ByteString(v)
180182
}
181183
}

crypto/src/main/scala/io/iohk/ethereum/crypto/MGF1BytesGeneratorExt.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.bouncycastle.crypto.Digest
1111
class MGF1BytesGeneratorExt(digest: Digest) {
1212
val digestSize: Int = digest.getDigestSize
1313

14-
private def itoOSP(i: Int, sp: Array[Byte]) {
14+
private def itoOSP(i: Int, sp: Array[Byte]): Unit = {
1515
sp(0) = (i >>> 24).toByte
1616
sp(1) = (i >>> 16).toByte
1717
sp(2) = (i >>> 8).toByte

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ object Dependencies {
9696

9797
val crypto = Seq("org.bouncycastle" % "bcprov-jdk15on" % "1.66")
9898

99-
val scopt = Seq("com.github.scopt" % "scopt_2.12" % "3.7.1")
99+
val scopt = Seq("com.github.scopt" %% "scopt" % "4.0.0")
100100

101101
val cli = Seq("com.monovore" %% "decline" % "1.3.0")
102102

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.2.8
1+
sbt.version = 1.3.6

project/plugins.sbt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
44
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
55
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.5")
66
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0")
7-
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.25")
87
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")
98
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
109
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
11-
12-
libraryDependencies += "com.trueaccord.scalapb" %% "compilerplugin" % "0.6.6"

project/project/manual-repo.nix

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

0 commit comments

Comments
 (0)