From acb52301fcce5c065b6b16350268f489fbeef68e Mon Sep 17 00:00:00 2001 From: chabanyknikita Date: Tue, 3 Sep 2024 16:10:38 +0300 Subject: [PATCH] fix age validation --- internal/service/handlers/get_proof_parameters.go | 2 +- internal/service/handlers/proof_params.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/handlers/get_proof_parameters.go b/internal/service/handlers/get_proof_parameters.go index 73246b1..8b93dfd 100644 --- a/internal/service/handlers/get_proof_parameters.go +++ b/internal/service/handlers/get_proof_parameters.go @@ -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 { diff --git a/internal/service/handlers/proof_params.go b/internal/service/handlers/proof_params.go index a74ef43..41ddbcb 100644 --- a/internal/service/handlers/proof_params.go +++ b/internal/service/handlers/proof_params.go @@ -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" }