-
Notifications
You must be signed in to change notification settings - Fork 75
ETCM-[165,166]: Move RLP and crypto into their own sub-projects #823
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
Conversation
8ef73f5
to
1c112cc
Compare
1c112cc
to
407926e
Compare
@@ -51,7 +50,7 @@ object RLPImplicits { | |||
implicit val bigIntEncDec = new RLPEncoder[BigInt] with RLPDecoder[BigInt] { | |||
|
|||
override def encode(obj: BigInt): RLPValue = RLPValue( | |||
if (obj.equals(BigInt(0))) byteToByteArray(0: Byte) else obj.toUnsignedByteArray | |||
if (obj.equals(BigInt(0))) byteToByteArray(0: Byte) else bigIntToUnsignedByteArray(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like toUnsignedByteArray
in BigIntExtensionMethods.BigIntAsUnsigned
has the same implementation as: bigIntToUnsignedByteArray
in RLP
Is his neccessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed a carbon copy. I brought it over because this was the only thing it used from the utils, and I didn't want to create a "mantis-utils" library for RLP to depend on, and it also didn't look like the entire ByteUtils
should be be moved to RLP. But I'm open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a dedicated mantis-bytes
library? Probably crypto would use it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a bytes
project, moved bigIntToUnsignedByteArray
to ByteUtils
, and now BigIntExtensionMethods
calls that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the same treatment for crypto.
7a02080
to
6f083f5
Compare
Description
Separates out the
rlp
andcrypto
packages into their own sbt sub-projects within the same build, so that at some point they can be published as standalone libraries. Because they both depended onByteUtils
a separatebytes
project was also created.Dependencies were cut down to the minimum, but Akka remains - I think RLP the formats that got to do with
ByteString
could be moved to thenode
at some point, but it seems more pervasive in crypto.The node jar keeps the
mantis
name so the Universal package as well as theHello.id
stays the same. Added theio.iohk
org.Also fixes coverage report paths, based on the logs these are the correct ones, but it could be different on buildkite: