Skip to content

Commit 09e01ce

Browse files
Avoid casting to u8 in both comparation sides when checking types
1 parent 0c9ec6e commit 09e01ce

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

contracts/src/core/AlignedProofAggregationService.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ contract AlignedProofAggregationService is
154154

155155
/// @notice Modifier to ensure the provided verifier type is one of the valid enum values.
156156
modifier onValidVerifierType(IAlignedProofAggregationService.VerifierType verifierType) {
157-
uint8 v = uint8(verifierType);
158-
if (v != uint8(IAlignedProofAggregationService.VerifierType.SP1) &&
159-
v != uint8(IAlignedProofAggregationService.VerifierType.RISC0)){
160-
revert IAlignedProofAggregationService.InvalidVerifierType(v);
157+
if (verifierType != IAlignedProofAggregationService.VerifierType.SP1 &&
158+
verifierType != IAlignedProofAggregationService.VerifierType.RISC0){
159+
revert IAlignedProofAggregationService.InvalidVerifierType(uint8(verifierType));
161160
}
162161

163162
_;

0 commit comments

Comments
 (0)