Skip to content

Commit

Permalink
specify for nft contract only
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan-Ultra committed Aug 6, 2024
1 parent 3e9943a commit 843bd1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions search/tokenization.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (t *tokenizer) tokenize(actTrace *pbcodec.ActionTrace) (out map[string]inte
}

if len(t.indexedTerms.Data) > 0 {
tokens := t.tokenizeData(actTrace.Action.JsonData)
tokens := t.tokenizeData(actTrace.Action.JsonData, actTrace.Account())
if len(tokens) > 0 {
out["data"] = tokens
}
Expand All @@ -77,7 +77,7 @@ func (t *tokenizer) tokenizeAuthority(authorizations []*pbcodec.PermissionLevel)
return
}

func (t *tokenizer) tokenizeData(data string) map[string]interface{} {
func (t *tokenizer) tokenizeData(data string, account string) map[string]interface{} {
if data == "" {
return nil
}
Expand All @@ -97,8 +97,10 @@ func (t *tokenizer) tokenizeData(data string) map[string]interface{} {
}

/* ultra-duncan --- BLOCK-2253 tokenize nft data field*/
if converted, err := tokenizeNFTDataField(normalizedField, normalizedValue); err == nil {
normalizedValue = converted
if account == "eosio.nft.ft" {
if converted, err := tokenizeNFTDataField(normalizedField, normalizedValue); err == nil {
normalizedValue = converted
}
}

out[normalizedField] = normalizedValue
Expand Down

0 comments on commit 843bd1f

Please sign in to comment.