Skip to content

Commit

Permalink
fix: ExtractEventData without prepending
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed Dec 10, 2024
1 parent 5457419 commit 0be5bc8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/service/handlers/helpers/proof_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0be5bc8

Please sign in to comment.