From e89e6c93d1314d86bed0e578994c4748ba47bb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=B8rch?= Date: Thu, 15 Aug 2024 09:03:04 +0200 Subject: [PATCH] chore: remove superfluous has matching check --- ProgramCommittee/Calculators/PaperRevealCalculator.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ProgramCommittee/Calculators/PaperRevealCalculator.cs b/ProgramCommittee/Calculators/PaperRevealCalculator.cs index 2e7bcb5..93dca39 100644 --- a/ProgramCommittee/Calculators/PaperRevealCalculator.cs +++ b/ProgramCommittee/Calculators/PaperRevealCalculator.cs @@ -47,16 +47,6 @@ public async Task CalculateAsync(CancellationToken cancellationToken) await foreach (var creationMessage in creationMessages) { - var paperHash = SHA256.HashData(creationMessage.Paper); - var hasMatching = await _appDbContext.LogEvents.AnyAsync(@event => - @event.Step == ProtocolStep.PaperReviewersMatching && @event.Identifier == paperHash - ); - - if (!hasMatching) - { - return; - } - var reviewRandomness = new BigInteger(creationMessage.ReviewRandomness); var reviewCommitment = Commitment.Create(creationMessage.Paper, reviewRandomness); var matchingMessage = await _messageFactory.GetMatchingMessageByCommitmentAsync(reviewCommitment.ToBytes()); @@ -87,6 +77,7 @@ public async Task CalculateAsync(CancellationToken cancellationToken) }; _logDbContext.Entries.Add(revealEntry); + var paperHash = SHA256.HashData(creationMessage.Paper); var logEvent = new LogEvent { Step = revealEntry.Step, Identifier = paperHash }; _appDbContext.LogEvents.Add(logEvent); }