darwinia-network / token-supply

token supply server
MIT License
0 stars 0 forks source link

Looks like missing some depedencies #2

Open fewensa opened 2 years ago

fewensa commented 2 years ago
[GIN-debug] GET    /supply/ring              --> github.com/darwinia-network/token/middleware.PageCache.func1 (4 handlers)
[GIN-debug] GET    /supply/kton              --> github.com/darwinia-network/token/middleware.PageCache.func1 (4 handlers)
[GIN-debug] GET    /api/status               --> github.com/darwinia-network/token/server/routers/http.Run.func1 (4 handlers)
[GIN-debug] GET    /api/supply               --> github.com/darwinia-network/token/middleware.PageCache.func1 (4 handlers)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x9728ae]

goroutine 36 [running]:
math/big.(*Int).Set(...)
        /opt/hostedtoolcache/go/1.18.3/x64/src/math/big/int.go:75
github.com/shopspring/decimal.NewFromBigInt(...)
        /home/runner/go/pkg/mod/github.com/shopspring/decimal@v1.3.1/decimal.go:123
github.com/darwinia-network/token/services/token.(*Currency).ethSupply(0xc0004180a0)
        /home/runner/work/token-supply/token-supply/services/token/supply.go:111 +0xce
github.com/darwinia-network/token/services/token.(*Currency).supply.func1()
        /home/runner/work/token-supply/token-supply/services/token/supply.go:70 +0x33
created by github.com/darwinia-network/token/services/token.(*Currency).supply
        /home/runner/work/token-supply/token-supply/services/token/supply.go:69 +0xea

When installed curl it's fixed

https://github.com/darwinia-network/token-supply/pull/1/commits/801c7259f6522aa6ef6bc39d457276951369f3f8

cinlk commented 2 years ago

It seems like Eth rpc calling failed that code parse data a nil value.