Skip to content

Commit

Permalink
improve tokenID parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Aug 13, 2022
1 parent 6eed5a9 commit 15c4b8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/subscriptions/listings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"math/big"
"regexp"
"strconv"
"strings"
"sync/atomic"
"time"

Expand Down Expand Up @@ -38,6 +39,8 @@ func StreamListingsHandler(workerID int, gOwnCollections *collections.Collection
tokenIDRaw := patternTokenID.ReplaceAllString(event.Payload.Item.Metadata.Name, "$2")
gbl.Log.Debugf("tokenIDRaw: %+v", tokenIDRaw)

tokenIDRaw = strings.TrimPrefix(tokenIDRaw, "#")

tokenID, err := strconv.ParseInt(tokenIDRaw, 10, 64)
if err != nil {
gbl.Log.Infof("error parsing tokenIDRaw to big.int: %s | %s | %s", event.Payload.Item.Metadata.Name, tokenIDRaw, err.Error())
Expand Down

0 comments on commit 15c4b8f

Please sign in to comment.