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:
parent
031b5342f1
commit
3e69092ae5
3
Makefile
3
Makefile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
package token
|
|
||||||
|
|
||||||
//go:generate go run ./downloader/main.go
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue