Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Dec 26, 2024
1 parent 227ea1e commit ad4d977
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _deploy/r/gnoswap/common/grc20reg_helper.gno
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"gno.land/r/demo/grc20reg"
)

var (
re = regexp.MustCompile(`\[gno\.land/r/[^\]]+\]`)
)

// GetToken returns a grc20.Token instance
// if token is not registered, it will panic
// token instance supports following methods:
Expand Down Expand Up @@ -70,10 +74,9 @@ func ListRegisteredTokens() []string {
}

func extractTokenPathsFromRender(render string) []string {
re := regexp.MustCompile(`\[gno\.land/r/[^\]]+\]`)
matches := re.FindAllString(render, -1)

tokenPaths := []string{}
tokenPaths := make([]string, 0, len(matches))
for _, match := range matches {
tokenPath := strings.Trim(match, "[]") // Remove the brackets
tokenPaths = append(tokenPaths, tokenPath)
Expand Down

0 comments on commit ad4d977

Please sign in to comment.