Skip to content

Commit

Permalink
Fix: ticket hash
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 28, 2023
1 parent fb887c0 commit cec0cde
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/models/ticket/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ticket

import (
"crypto/sha256"
"encoding/binary"
"encoding/hex"

"github.com/baking-bad/bcdhub/internal/models/account"
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit cec0cde

Please sign in to comment.