chore_: move uniswap token downloading to makefile target (#5891)

* chore_: move uniswap token downloading to makefile target

* fix_: uniswap url and output path

* feat_: upgrade uniswap tokens
This commit is contained in:
Igor Sirotin 2024-10-01 10:20:03 +01:00 committed by GitHub
parent 031b5342f1
commit 3e69092ae5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 872 additions and 1364 deletions

View File

@ -320,6 +320,9 @@ generate: ##@other Regenerate assets and other auto-generated stuff
generate-appdatabase: generate-appdatabase:
go generate ./appdatabase/... go generate ./appdatabase/...
download-uniswap-tokens:
go run ./services/wallet/token/downloader/main.go
prepare-release: clean-release prepare-release: clean-release
mkdir -p $(RELEASE_DIR) mkdir -p $(RELEASE_DIR)
mv build/bin/statusgo.aar $(RELEASE_DIR)/status-go-android.aar mv build/bin/statusgo.aar $(RELEASE_DIR)/status-go-android.aar

View File

@ -15,8 +15,11 @@ import (
"github.com/xeipuuv/gojsonschema" "github.com/xeipuuv/gojsonschema"
) )
const uniswapTokensURL = "https://gateway.ipfs.io/ipns/tokens.uniswap.org" // nolint:gosec const (
const tokenListSchemaURL = "https://uniswap.org/tokenlist.schema.json" // nolint:gosec uniswapTokensURL = "https://ipfs.io/ipns/tokens.uniswap.org" // nolint:gosec
tokenListSchemaURL = "https://uniswap.org/tokenlist.schema.json" // nolint:gosec
outputFile = "services/wallet/token/uniswap.go"
)
const templateText = ` const templateText = `
package token package token
@ -100,7 +103,7 @@ func main() {
tmpl := template.Must(template.New("tokens").Parse(templateText)) tmpl := template.Must(template.New("tokens").Parse(templateText))
// Create the output Go file // Create the output Go file
file, err := os.Create("uniswap.go") file, err := os.Create(outputFile)
if err != nil { if err != nil {
fmt.Printf("Failed to create go file: %v\n", err) fmt.Printf("Failed to create go file: %v\n", err)
return return

View File

@ -1,3 +0,0 @@
package token
//go:generate go run ./downloader/main.go

File diff suppressed because it is too large Load Diff