Skip to content

Commit

Permalink
data hash in ticket_id's changed to hex string
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ok123 committed Apr 15, 2022
1 parent d70f903 commit f31b93b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion supernode/services/cascaderegister/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (task *CascadeRegistrationTask) signAndSendCascadeTicket(ctx context.Contex
func (task *CascadeRegistrationTask) registerAction(ctx context.Context) (string, error) {
log.WithContext(ctx).Debug("all signature received so start validation")

ticketID := fmt.Sprintf("%s.%d.%s", task.Ticket.Caller, task.Ticket.BlockNum, task.dataHash)
ticketID := fmt.Sprintf("%s.%d.%s", task.Ticket.Caller, task.Ticket.BlockNum, hex.EncodeToString(task.dataHash))

req := pastel.RegisterActionRequest{
Ticket: &pastel.ActionTicket{
Expand Down
3 changes: 2 additions & 1 deletion supernode/services/senseregister/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package senseregister

import (
"context"
"encoding/hex"
"fmt"
"time"

Expand Down Expand Up @@ -322,7 +323,7 @@ func (task *SenseRegistrationTask) signAndSendSenseTicket(ctx context.Context, i
func (task *SenseRegistrationTask) registerAction(ctx context.Context) (string, error) {
log.WithContext(ctx).Debug("all signature received so start validation")

ticketID := fmt.Sprintf("%s.%d.%s", task.Ticket.Caller, task.Ticket.BlockNum, task.dataHash)
ticketID := fmt.Sprintf("%s.%d.%s", task.Ticket.Caller, task.Ticket.BlockNum, hex.EncodeToString(task.dataHash))

req := pastel.RegisterActionRequest{
Ticket: &pastel.ActionTicket{
Expand Down
5 changes: 3 additions & 2 deletions walletnode/services/nftregister/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nftregister

import (
"context"
"encoding/hex"
"fmt"
"os"
"strconv"
Expand Down Expand Up @@ -435,7 +436,7 @@ func (task *NftRegistrationTask) sendSignedTicket(ctx context.Context) error {
return errors.Errorf("node %s is not NftRegistrationNode", someNode.String())
}

ticketID := fmt.Sprintf("%s.%d.%s", task.Request.CreatorPastelID, task.creatorBlockHeight, task.dataHash)
ticketID := fmt.Sprintf("%s.%d.%s", task.Request.CreatorPastelID, task.creatorBlockHeight, hex.EncodeToString(task.dataHash))
key1 := ticketID
key2 := uuid.New().String()
group.Go(func() error {
Expand Down Expand Up @@ -467,7 +468,7 @@ func (task *NftRegistrationTask) sendSignedTicket(ctx context.Context) error {
return errors.Errorf("registration fees don't match")
}

// check if fee is over-expection
// check if fee is over-expectation
task.registrationFee = fees[0]

if task.registrationFee > int64(task.Request.MaximumFee) {
Expand Down

0 comments on commit f31b93b

Please sign in to comment.