Skip to content

Commit

Permalink
check for weird prefix in token ID
Browse files Browse the repository at this point in the history
  • Loading branch information
benny-conn committed Oct 23, 2023
1 parent 708b9db commit e6d83ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ $(DEPLOY)-%-userpref-upload : DOCKER_FILE := $(DOCKER_DIR)/userpre
$(PROMOTE)-%-backend : SERVICE := default
$(PROMOTE)-%-indexer : SERVICE := indexer
$(PROMOTE)-%-indexer-server : SERVICE := indexer-api
$(PROMOTE)-%-emails : SERVICE := emails
$(PROMOTE)-%-emails : SERVICE := emails-v2
$(PROMOTE)-%-tokenprocessing : SERVICE := tokenprocessing
$(PROMOTE)-%-tokenprocessing : SERVICE := tokenprocessing-v3
$(PROMOTE)-%-autosocial : SERVICE := autosocial
Expand Down
13 changes: 11 additions & 2 deletions service/multichain/zora/zora.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ type Provider struct {
type tokenID string

func (t tokenID) toBase16String() string {
big, ok := new(big.Int).SetString(string(t), 10)
copy := string(t)
if strings.Contains("-", copy) {
// take what is after the dash
parts := strings.Split(copy, "-")
if len(parts) != 2 {
panic(fmt.Sprintf("invalid token id %s", t))
}
copy = parts[1]
}
big, ok := new(big.Int).SetString(copy, 10)
if !ok {
panic("invalid token ID")
panic(fmt.Sprintf("invalid token id %s", t))
}
return big.Text(16)
}
Expand Down

0 comments on commit e6d83ec

Please sign in to comment.