Skip to content

Commit

Permalink
chore: remove superfluous has matching check
Browse files Browse the repository at this point in the history
  • Loading branch information
mrphil2105 committed Aug 15, 2024
1 parent fd4f8bd commit e89e6c9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions ProgramCommittee/Calculators/PaperRevealCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit e89e6c9

Please sign in to comment.