Skip to content

Conversation

@GRYE
Copy link
Contributor

@GRYE GRYE commented Nov 14, 2019

No description provided.

case Left(value) => ProcessNewSnapshotError(value.getMessage).asLeft[SnapshotProcessor]
case Right(_) => this.asRight[ProcessNewSnapshotError]
): Either[ProcessNewSnapshotError, SnapshotProcessor] =
if (potentialManifestsIds.exists(_.sameElements(id)))
Copy link
Member

Choose a reason for hiding this comment

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

Don't take this value from db 2 times (here and at 212 line) potentialManifestsIds. Take it only 1 time

if (!manifestIds.exists(_.sameElements(id))) {
snapshotProcessor.createNewSnapshot(id, manifestIds, chunks)
} else logger.info(s"Doesn't need to create snapshot")

Copy link
Member

Choose a reason for hiding this comment

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

remove empty line

import encry.network.NodeViewSynchronizer.ReceivableMessages.{ ChangedHistory, SemanticallySuccessfulModifier }
import encry.storage.VersionalStorage.{ StorageKey, StorageValue }
import encry.view.fast.sync.FastSyncExceptions.{ ApplicableChunkIsAbsent, FastSyncException }
import encry.network.BlackList.BanReason.{ExpiredNumberOfReRequestAttempts, ExpiredNumberOfRequests, InvalidChunkMessage, InvalidResponseManifestMessage, InvalidStateAfterFastSync, NotAllChunksSentMessage, UnrequestedChunksSentMessage}
Copy link
Member

Choose a reason for hiding this comment

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

make imports formatting


"process new snapshot function" should {

"correctly create new snapshot if such doesn't exist" in {
Copy link
Member

Choose a reason for hiding this comment

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

rewrite this test

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.

3 participants