Skip to content

Commit

Permalink
chore: code comments improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Czeladka committed Nov 14, 2023
1 parent 6c10c26 commit e3e4e8b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class DiscordUserVerificationResource {
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> isDiscordUserVerified(@PathVariable("discordIdHash") String discordIdHash) {
Expand Down Expand Up @@ -99,7 +99,7 @@ public ResponseEntity<?> isDiscordUserVerified(@PathVariable("discordIdHash") St
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> startVerification(@RequestBody @Valid DiscordStartVerificationRequest startVerificationRequest) {
Expand Down Expand Up @@ -136,7 +136,7 @@ public ResponseEntity<?> startVerification(@RequestBody @Valid DiscordStartVerif
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> checkVerification(@RequestBody @Valid DiscordCheckVerificationRequest checkVerificationRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SMSUserVerificationResource {
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> startVerification(@RequestBody @Valid SMSStartVerificationRequest startVerificationRequest) {
Expand Down Expand Up @@ -90,13 +90,13 @@ public ResponseEntity<?> startVerification(@RequestBody @Valid SMSStartVerificat
),
@ApiResponse(
responseCode = "400",
description = "Bad request, possibly due to an invalid checkVerificationRequest.",
description = "Bad request, possibly due to an invalid SMS code in the check verification request.",
content = {
@Content(mediaType = "application/json",
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> checkVerification(@RequestBody @Valid SMSCheckVerificationRequest checkVerificationRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class UserVerificationResource {
schema = @Schema(implementation = Problem.class))
}
),
@ApiResponse(responseCode = "500", description = "Server error")
@ApiResponse(responseCode = "500", description = "Internal server error")
}
)
public ResponseEntity<?> isVerified(@PathVariable("eventId") String eventId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.cardano.foundation.voting;

import com.bloxbean.cardano.client.backend.blockfrost.service.http.*;
import com.bloxbean.cardano.client.backend.model.TransactionContent;
import io.micrometer.core.aop.TimedAspect;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.aot.hint.ExecutableMode;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.boot.CommandLineRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private List<L1MerkleCommitment> getValidL1MerkleCommitments() {
var allFinishedEventsWithClosedCommitmentWindow = allFinishedEventsWithClosedCommitmentWindowE.get();

List<ChainFollowerClient.EventSummary> eventsToProcess2 = allFinishedEventsWithClosedCommitmentWindow.stream()
// if we find at least one vote merkle proof which is not validated
.filter(eventSummary -> !voteMerkleProofService.findTop1InvalidatedByEventId(eventSummary.id()).isEmpty())
.toList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void onBlock(Era era, Block block, List<Transaction> transactions) {

@Override
public void onRollback(Point point) {
Either<Problem, List<ChainFollowerClient.EventSummary>> allCommitmentWindowOpenEventsE = chainFollowerClient.findAllCommitmentWindowOpenEvents();
var allCommitmentWindowOpenEventsE = chainFollowerClient.findAllCommitmentWindowOpenEvents();

if (allCommitmentWindowOpenEventsE.isEmpty()) {
var issue = allCommitmentWindowOpenEventsE.swap().get();
Expand All @@ -91,17 +91,17 @@ public void onRollback(Point point) {
return;
}

List<ChainFollowerClient.EventSummary> allCommitmentWindowOpenEvents = allCommitmentWindowOpenEventsE.get();
var allCommitmentWindowOpenEvents = allCommitmentWindowOpenEventsE.get();

if (allCommitmentWindowOpenEvents.isEmpty()) {
log.info("No commitment window open events found. Skipping rollback handler...");

return;
}

long absoluteSlot = point.getSlot();
var absoluteSlot = point.getSlot();

for (ChainFollowerClient.EventSummary eventSummary : allCommitmentWindowOpenEvents) {
for (var eventSummary : allCommitmentWindowOpenEvents) {
String eventId = eventSummary.id();

log.info("Processing rollback for eventId: {}, absoluteSlot: {}", eventId, absoluteSlot);
Expand Down

0 comments on commit e3e4e8b

Please sign in to comment.