Skip to content

Commit

Permalink
fix age validation
Browse files Browse the repository at this point in the history
  • Loading branch information
chabanyknikita committed Sep 3, 2024
1 parent fdf9bd4 commit acb5230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/service/handlers/get_proof_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func CalculateProofSelector(uniqueness bool, ageLowerBound int, nationality stri
if nationality != "" {
bitLine |= 1 << citizenshipBit
}
if ageLowerBound != 0 {
if ageLowerBound != -1 {
bitLine |= 1 << birthDateUpperboundBit
}
if uniqueness {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/handlers/proof_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func GetProofParamsById(w http.ResponseWriter, r *http.Request) {
}

birthDateUpperBound := CalculateBirthDateHex(existingUser.AgeLowerBound)
if existingUser.AgeLowerBound == 0 {
if existingUser.AgeLowerBound == -1 {
birthDateUpperBound = "0x303030303030"
}

Expand Down

0 comments on commit acb5230

Please sign in to comment.