diff --git a/.golangci.yml b/.golangci.yml index d679ee99..cd3bcde3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,6 +47,7 @@ ], "disabled-checks": [ "hugeParam", + "unnamedResult", ] } }, diff --git a/Makefile b/Makefile index f1fea3f6..5b884404 100644 --- a/Makefile +++ b/Makefile @@ -137,4 +137,4 @@ tests: coverage: go test -race -coverprofile=coverage.out -covermode=atomic ./client/... ./ethereum/... -.PHONY: copy-exchange-client tests coverage \ No newline at end of file +.PHONY: copy-exchange-client tests coverage diff --git a/client/chain/chain.go b/client/chain/chain.go index 26d50e5b..0ee9d14a 100644 --- a/client/chain/chain.go +++ b/client/chain/chain.go @@ -387,9 +387,9 @@ func NewChainClient( var err error stickySessionEnabled := true if opts.TLSCert != nil { - conn, err = grpc.Dial(network.ChainGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ChainGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) } else { - conn, err = grpc.Dial(network.ChainGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ChainGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) stickySessionEnabled = false } if err != nil { @@ -399,9 +399,9 @@ func NewChainClient( var chainStreamConn *grpc.ClientConn if opts.TLSCert != nil { - chainStreamConn, err = grpc.Dial(network.ChainStreamGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) + chainStreamConn, err = grpc.NewClient(network.ChainStreamGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) } else { - chainStreamConn, err = grpc.Dial(network.ChainStreamGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) + chainStreamConn, err = grpc.NewClient(network.ChainStreamGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) } if err != nil { err = errors.Wrapf(err, "failed to connect to the chain stream gRPC: %s", network.ChainStreamGrpcEndpoint) diff --git a/client/exchange/exchange.go b/client/exchange/exchange.go index cc4b3f3b..a93571ae 100644 --- a/client/exchange/exchange.go +++ b/client/exchange/exchange.go @@ -111,10 +111,10 @@ func NewExchangeClient(network common.Network, options ...common.ClientOption) ( var conn *grpc.ClientConn var err error if opts.TLSCert != nil { - conn, err = grpc.Dial(network.ExchangeGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ExchangeGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) } else { - conn, err = grpc.Dial(network.ExchangeGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ExchangeGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) } if err != nil { err := errors.Wrapf(err, "failed to connect to the gRPC: %s", network.ExchangeGrpcEndpoint) diff --git a/client/explorer/explorer.go b/client/explorer/explorer.go index 2dbe8ce8..ce9fff24 100644 --- a/client/explorer/explorer.go +++ b/client/explorer/explorer.go @@ -50,9 +50,9 @@ func NewExplorerClient(network common.Network, options ...common.ClientOption) ( var conn *grpc.ClientConn var err error if opts.TLSCert != nil { - conn, err = grpc.Dial(network.ExplorerGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ExplorerGrpcEndpoint, grpc.WithTransportCredentials(opts.TLSCert), grpc.WithContextDialer(common.DialerFunc)) } else { - conn, err = grpc.Dial(network.ExplorerGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) + conn, err = grpc.NewClient(network.ExplorerGrpcEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(common.DialerFunc)) } if err != nil { err := errors.Wrapf(err, "failed to connect to the gRPC: %s", network.ExplorerGrpcEndpoint)