Skip to content
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

ec-555 #294

Merged
merged 56 commits into from Mar 11, 2019
Merged

ec-555 #294

merged 56 commits into from Mar 11, 2019

Conversation

GusevTimofey
Copy link
Member

No description provided.

syntax = "proto3";
import "scalapb/scalapb.proto";

option optimize_for = SPEED;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary to set optimize_for to speed

case Payload.`modifierTypeId` => PayloadSerializer.parseBytes(bytes.tail)
case m => Failure(new Exception(s"Deserialization for unknown type byte: $m"))
}
def fromProto(bytes: Array[Byte]): Try[EncryPersistentModifier] = Try(bytes.head).flatMap {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can match bytes head directly

case MessageFromNetwork(message, Some(remote)) =>
message match {
case message@SyncInfoNetworkMessage(_) =>
findHandler(message, NetworkMessagesIds.SyncInfo, remote, messagesHandlers)
Copy link
Member

@Bromel777 Bromel777 Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add check for data size (objects qty)

logger-startup-timeout = 60s
loggers = ["akka.event.slf4j.Slf4jLogger"]
actor.warn-about-java-serializer-usage = false
persistence {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove persistence settings

transferDirectiveWithoutTokenIdFromProto.get.tokenIdOpt shouldBe None
}

property("Transaction should be serialized correctly") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test for signature compr

@@ -103,37 +102,41 @@ class PeerConnectionHandler(messagesHandler: MessageHandler,
peerManager ! Handshaked(peer)
handshakeTimeoutCancellableOpt.map(_.cancel())
connection ! ResumeReading
logger.info(s"Context become workingCycle on peerHandler")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to debug

mH.find(_._1.contains(messageId)).map(_._2) match {
case Some(handler) =>
handler ! DataFromPeer(message, remote)
logger.info(s"Send message DataFromPeer with ${message.messageName} to $handler.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to debug

@@ -26,6 +28,8 @@ class MinerWalletBalanceTest extends AsyncFunSuite with Matchers with NodesFromD

val height = dockerNodes().head.waitForHeadersHeight(heightToCheck)
Await.result(height, 30.minutes)
val boxes: Seq[EncryBaseBox] = Await.result(dockerNodes().head.outputs, 30.minutes)
val oneBox: AssetBox = boxes.collect { case ab: AssetBox => ab }.head
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This val is not used anywhere (same as one above)

val syncInfoToProto: GeneralizedNetworkProtoMessage.InnerMessage = syncInfoBeforeProto.toInnerMessage
val syncInfoFromProto: Option[SyncInfoNetworkMessage] = SyncInfoNetworkMessageSerializer.fromProto(syncInfoToProto)

val comparison: Set[Boolean] = syncInfoFromProto.get.esi.lastHeaderIds.map(id =>
Copy link
Member

@Bromel777 Bromel777 Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use forall instead of map

case Failure(e) => logger.error(s"Failed to deserialize data: $e")
}
case MessageFromNetwork(message, Some(remote)) if message.isValid(settings) =>
logger.info(s"Got ${message.messageName} on the NetworkController.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to debug

@GusevTimofey GusevTimofey merged commit 6ca20ae into master Mar 11, 2019
@GusevTimofey GusevTimofey deleted the ec-555 branch June 16, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants