From 0be5bc8c800b0a16d3bbbf7ccfe12e932e11cad5 Mon Sep 17 00:00:00 2001 From: Maksym Hrynenko Date: Tue, 10 Dec 2024 16:27:26 +0200 Subject: [PATCH] fix: ExtractEventData without prepending --- internal/service/handlers/helpers/proof_params.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/service/handlers/helpers/proof_params.go b/internal/service/handlers/helpers/proof_params.go index 9e209f0..9a6f57a 100644 --- a/internal/service/handlers/helpers/proof_params.go +++ b/internal/service/handlers/helpers/proof_params.go @@ -100,14 +100,12 @@ func FormatDateTime(date time.Time) string { } func ExtractEventData(getter zk.PubSignalGetter) (string, error) { - userIDHashDecimal, ok := new(big.Int).SetString(getter.Get(zk.EventData), 10) + userIDBig, ok := new(big.Int).SetString(getter.Get(zk.EventData), 10) if !ok { return "", fmt.Errorf("failed to parse event data") } - var userIDHash [32]byte - userIDHashDecimal.FillBytes(userIDHash[:]) - return fmt.Sprintf("0x%s", hex.EncodeToString(userIDHash[:])), nil + return fmt.Sprintf("0x%s", userIDBig.Text(16)), nil } func CalculateProofSelector(p SelectorParams) int {