Skip to content

Commit

Permalink
fix solhint and custom errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Jan 9, 2025
1 parent 7005a64 commit 85804dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions contracts/interfaces/IVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ interface IVerifier {
* @dev Sets different requests
* @param requests List of requests
*/
function setRequests(
Request[] calldata requests
) external;
function setRequests(Request[] calldata requests) external;

/**
* @dev Gets a specific request by ID
Expand Down
8 changes: 5 additions & 3 deletions contracts/verifiers/Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ error RequestIsAlreadyGrouped(uint256 requestId);
error LinkIDNotTheSameForGroupedRequests(uint256 requestLinkID, uint256 requestLinkIDToCompare);
error UserIDNotFound(uint256 userID);
error UserIDNotLinkedToAddress(uint256 userID, address userAddress);
error UserNotAuthenticated();
error MetadataNotSupportedYet();

abstract contract Verifier is IVerifier, ContextUpgradeable {
/// @dev Key to retrieve the linkID from the proof storage
Expand Down Expand Up @@ -239,7 +241,7 @@ abstract contract Verifier is IVerifier, ContextUpgradeable {
for (uint256 i = 0; i < requests.length; i++) {
uint256 groupID = requests[i].validator.getRequestParams(requests[i].params).groupID;
if (groupID != 0 && groupIdExists(groupID)) {
revert("Group ID already exists");
revert GroupIdAlreadyExists(groupID);
}
}

Expand Down Expand Up @@ -364,7 +366,7 @@ abstract contract Verifier is IVerifier, ContextUpgradeable {
}

if (userIDFromReponse == 0) {
revert("The user is not authenticated");
revert UserNotAuthenticated();
}

// 3. Verify all the responses, write proof results (under the userID key from the auth of the user),
Expand All @@ -383,7 +385,7 @@ abstract contract Verifier is IVerifier, ContextUpgradeable {
$.writeProofResults(response.requestId, sender, signals);

if (response.metadata.length > 0) {
revert("Metadata not supported yet");
revert MetadataNotSupportedYet();
}
}
}
Expand Down

0 comments on commit 85804dd

Please sign in to comment.