From cec0cde3ca15d1625a27b01371d2da0eb363cfd0 Mon Sep 17 00:00:00 2001 From: Artem Date: Fri, 29 Sep 2023 02:10:31 +0400 Subject: [PATCH] Fix: ticket hash --- internal/models/ticket/ticket.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/models/ticket/ticket.go b/internal/models/ticket/ticket.go index c41076c0e..9c56cb885 100644 --- a/internal/models/ticket/ticket.go +++ b/internal/models/ticket/ticket.go @@ -2,7 +2,6 @@ package ticket import ( "crypto/sha256" - "encoding/binary" "encoding/hex" "github.com/baking-bad/bcdhub/internal/models/account" @@ -34,7 +33,7 @@ func (t Ticket) Hash() string { data := make([]byte, len(t.ContentType)) copy(data, t.ContentType) data = append(data, t.Content...) - data = binary.AppendVarint(data, t.TicketerID) + data = append(data, []byte(t.Ticketer.Address)...) h := sha256.New() _, _ = h.Write(data) return hex.EncodeToString(h.Sum(nil))