Update deprecated function usages (#8953)

* Clear deprecated usages within Prysm

* Remove deprecatd usages where possible

* Update
This commit is contained in:
Ivan Martinez
2021-05-28 02:57:47 -04:00
committed by GitHub
parent 6bb3cc45ef
commit 40b4079924
8 changed files with 13 additions and 13 deletions

View File

@@ -14,7 +14,6 @@ go_library(
"//proto/beacon/rpc/v1:go_default_library",
"//shared/logutil:go_default_library",
"//shared/version:go_default_library",
"@com_github_golang_protobuf//ptypes:go_default_library_gen",
"@com_github_libp2p_go_libp2p_core//network:go_default_library",
"@com_github_libp2p_go_libp2p_core//peer:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
@@ -23,6 +22,7 @@ go_library(
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@org_golang_google_protobuf//types/known/timestamppb:go_default_library",
],
)

View File

@@ -9,7 +9,6 @@ import (
"sort"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/empty"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/libp2p/go-libp2p-core/network"
@@ -25,6 +24,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
)
// Server defines a server implementation of the gRPC Node service,
@@ -62,12 +62,9 @@ func (ns *Server) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesi
var defaultGenesisTime time.Time
var gt *timestamp.Timestamp
if genesisTime == defaultGenesisTime {
gt, err = ptypes.TimestampProto(time.Unix(0, 0))
gt = timestamppb.New(time.Unix(0, 0))
} else {
gt, err = ptypes.TimestampProto(genesisTime)
}
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not convert genesis time to proto: %v", err)
gt = timestamppb.New(genesisTime)
}
genValRoot := ns.GenesisFetcher.GenesisValidatorRoot()