@@ -93,24 +93,18 @@ library ZKEmailUtils {
93
93
return EmailProofError.MaskedCommandLength;
94
94
} else if (emailAuthMsg.skippedCommandPrefix >= verifier.commandBytes ()) {
95
95
return EmailProofError.SkippedCommandPrefixSize;
96
- } else if (! _commandMatch (emailAuthMsg, template, stringCase)) {
97
- return EmailProofError.MismatchedCommand;
98
- } else {
99
- return verifier.verifyEmailProof (emailAuthMsg.proof) ? EmailProofError.NoError : EmailProofError.EmailProof;
100
- }
101
- }
102
-
103
- function _commandMatch (
104
- EmailAuthMsg memory emailAuthMsg ,
105
- string [] memory template ,
106
- Case stringCase
107
- ) private pure returns (bool ) {
108
- return
96
+ } else if (
109
97
stringCase == Case.ANY
110
98
? _matchAnyCase (emailAuthMsg, template)
111
- : _matchCase (emailAuthMsg, template, stringCase);
99
+ : _matchCase (emailAuthMsg, template, stringCase)
100
+ ) {
101
+ return verifier.verifyEmailProof (emailAuthMsg.proof) ? EmailProofError.NoError : EmailProofError.EmailProof;
102
+ } else {
103
+ return EmailProofError.MismatchedCommand;
104
+ }
112
105
}
113
106
107
+ /// @dev Checks if the command matches the expected command for any string case.
114
108
function _matchAnyCase (EmailAuthMsg memory emailAuthMsg , string [] memory template ) private pure returns (bool ) {
115
109
return
116
110
_matchCase (emailAuthMsg, template, Case.LOWERCASE) ||
0 commit comments