Skip to content

Commit

Permalink
Upgrade 0Chain GoSDK to v1.8.11 (#898)
Browse files Browse the repository at this point in the history
* upgrade GoSDK to v1.8.11

* fix(zcncore): removed unused GetBlobbers

* chore(gomod): upgraded deps

Co-authored-by: service-0chain <service-0chain@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
  • Loading branch information
3 people committed Dec 29, 2022
1 parent f6777ca commit d78617d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 110 deletions.
27 changes: 0 additions & 27 deletions code/go/0chain.net/blobbercore/handler/zcncore.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package handler

import (
"encoding/json"
"sync"

"github.com/0chain/blobber/code/go/0chain.net/core/common"
Expand Down Expand Up @@ -70,32 +69,6 @@ func CheckBalance() (float64, error) {
return zcncore.ConvertToToken(statusBar.balance), nil
}

func GetBlobbers() ([]*zcncore.Blobber, error) {
var info struct {
Nodes []*zcncore.Blobber
}

wg := &sync.WaitGroup{}
statusBar := &ZCNStatus{wg: wg}
wg.Add(1)

err := zcncore.GetBlobbers(statusBar)
if err != nil {
return info.Nodes, common.NewError("get_blobbers_failed", "Call to GetBlobbers failed with err: "+err.Error())
}
wg.Wait()

if !statusBar.success {
return info.Nodes, nil
}

if err = json.Unmarshal([]byte(statusBar.info), &info); err != nil {
return info.Nodes, common.NewError("get_blobbers_failed", "Decoding response to GetBlobbers failed with err: "+err.Error())
}

return info.Nodes, nil
}

func CallFaucet() error {
wg := &sync.WaitGroup{}
statusBar := &ZCNStatus{wg: wg}
Expand Down
57 changes: 29 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ go 1.18

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.8.10
github.com/0chain/gosdk v1.8.11
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/didip/tollbooth/v6 v6.1.2
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0
github.com/herumi/bls-go-binary v1.28.2
github.com/improbable-eng/grpc-web v0.15.0
github.com/koding/cache v0.0.0-20161222233015-e8a81b0b3f20
Expand All @@ -20,11 +20,11 @@ require (
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a
golang.org/x/net v0.1.0 // indirect
golang.org/x/time v0.1.0 // indirect
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c
google.golang.org/grpc v1.50.1
golang.org/x/crypto v0.4.0
golang.org/x/net v0.4.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef
google.golang.org/grpc v1.51.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.28.1
gopkg.in/natefinch/lumberjack.v2 v2.0.0
Expand All @@ -39,16 +39,17 @@ require (
)

require (
github.com/btcsuite/btcd v0.23.2 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
github.com/btcsuite/btcd/btcutil v1.1.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/Luzifer/go-openssl/v4 v4.1.0 // indirect
github.com/btcsuite/btcd v0.23.4 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/ethereum/go-ethereum v1.10.25 // indirect
github.com/ethereum/go-ethereum v1.10.26 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand All @@ -66,37 +67,37 @@ require (
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.13.0 // indirect
github.com/jackc/pgx/v4 v4.17.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/cpuid/v2 v2.1.2 // indirect
github.com/klauspost/reedsolomon v1.11.1 // indirect
github.com/klauspost/compress v1.15.13 // indirect
github.com/klauspost/cpuid/v2 v2.2.2 // indirect
github.com/klauspost/reedsolomon v1.11.3 // indirect
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-sqlite3 v1.14.15 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.dedis.ch/fixbuf v1.0.3 // indirect
go.dedis.ch/kyber/v3 v3.0.14 // indirect
go.dedis.ch/kyber/v3 v3.1.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/text v0.4.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/text v0.5.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down

0 comments on commit d78617d

Please sign in to comment.