-
Notifications
You must be signed in to change notification settings - Fork 75
[ETCM-129] Scala 2.13 #875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
dade78e
[ETCM-266]-replaced-rate-limiter-built-on-twitter
a9caf47
Formatting applied
06b8b33
Fixed test to advance time programmaticaly
a2a4a26
Transit to guava cache
93b0aa0
Initial commit
2fd002a
[ETCM-129] - starting point of migration
e3d1594
Next step to 2.13
80e6ff5
Completed and tested 2.13 migration
e9089fe
Scalafmt fixes
0a27104
Updated nix expressions
cfb875f
Fixed imports in integration test
deea98c
First review fixes
426fd6e
Updated nix expressions
23bdbec
Merge branch 'develop' into feature/ETCM-129-scala-point-13
ae3348a
Nix files regenerated
2dce3cd
updated buildkite config
eb45270
Try another sbtix
7117dbe
Trying to downgrade sbt
484b690
Fixed deprecation warning
42cf732
Another deprecated warning
cc226ff
Updated more tests
d0a0f95
Merge branch 'develop' into feature/ETCM-129-scala-point-13
25ee0c1
More tests fixed
00cdbff
Add protoc options
jonringer 1d01ff2
Use sbt-protoc==0.99
jonringer 33973cf
Add sbt-derivation source
jonringer b30da41
Remove sbtix files
jonringer d2db8ec
WIP
jonringer 695ffa4
Update nixpkgs, cleanup nix files
jonringer 485a2c4
Use sbt-protoc 0.99.34, fix build
jonringer e574330
Remove more sbtix files
jonringer ce1d4d2
Remove sbtix references from buildkite
jonringer 63db00c
Fix wrapper
jonringer 465f1c6
Add update script
jonringer d9fd0f5
Update readme
jonringer 7a1531a
Update buildkite nix smoke test
jonringer 554d6db
Use newer version of nix for buildkite
jonringer de3145b
Use nixUnstable instead
jonringer 218c05c
Use nixUnstable within update-nix.sh
jonringer fd113cd
Don't rely on PATH
jonringer e8d33c7
Use nix-cli 1.0 for hash calculation
jonringer bec2be4
Elaborate update instructions
jonringer 29b6c7b
Merge pull request #882 from input-output-hk/feature/ETCM-129-scala-p…
ec36746
Merge branch 'develop' into feature/ETCM-129-scala-point-13
0f57d0e
Use only jdk8 when building nix
jonringer aae9ff5
Merge pull request #885 from input-output-hk/use-jdk8-nix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ metals.sbt | |
|
||
# Nix | ||
result | ||
.nix/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
bytes/src/test/scala/io/iohk/ethereum/utils/ByteStringUtilsTest.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.iohk.ethereum.utils | ||
|
||
import akka.util.ByteString | ||
import org.scalatest.wordspec.AnyWordSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import ByteStringUtils._ | ||
import scala.collection.immutable.ArraySeq | ||
import scala.util.{Try, Success, Failure} | ||
|
||
class ByteStringUtilsTest extends AnyWordSpec with Matchers { | ||
|
||
"ByteStringUtilsTest" should { | ||
enriquerodbe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
"succeed parsing a valid hash string" in { | ||
val validHashString = "00FF00FF" | ||
val parsed = Try(string2hash(validHashString)) | ||
val expected = ByteString(Array[Byte](0, -1, 0, -1)) | ||
parsed shouldEqual Success(expected) | ||
} | ||
|
||
"fail parsing a valid hash string" in { | ||
val invalidHashString = "XXYYZZXX" | ||
val parsed = Try(string2hash(invalidHashString)) | ||
parsed shouldBe a[Failure[_]] | ||
} | ||
|
||
"concatByteStrings for simple bytestrings" in { | ||
val bs1 = string2hash("0000") | ||
val bs2 = string2hash("FFFF") | ||
val summarized: ByteString = bs1 ++ bs2 | ||
|
||
val concatenated: ByteString = ByteStringUtils.concatByteStrings(bs1, bs2) | ||
summarized shouldEqual concatenated | ||
} | ||
|
||
"concatByteStrings for various argument types" in { | ||
val bs1 = string2hash("0000") | ||
val bs2 = string2hash("FFFF") | ||
val bs3: Byte = 2 | ||
val bs4 = Array[Byte](3, 3) | ||
val bs5 = Array[Byte](4, 4) | ||
val summarized: ByteString = bs1 ++ bs2 | ||
val concatenated: ByteString = ByteStringUtils.concatByteStrings(bs1, bs2, bs3, bs4, bs5) | ||
concatenated shouldEqual string2hash("0000FFFF0203030404") | ||
} | ||
|
||
"apply padding the same way seqOps does" in { | ||
val bsu = string2hash("0000FFFF") | ||
val seq = ArraySeq.unsafeWrapArray(bsu.toArray) | ||
bsu.padToByteString(3, 0) shouldEqual bsu // result is ByteString | ||
bsu.padTo(3,0) shouldEqual seq // result is Seq | ||
|
||
val longSeq = ArraySeq[Byte](0, 0, -1, -1, 1 ,1) | ||
val longBsu = string2hash("0000FFFF0101") | ||
bsu.padToByteString(6, 1) shouldEqual longBsu | ||
bsu.padTo(6, 1) shouldEqual longSeq | ||
} | ||
|
||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.