mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Update deprecated function usages (#8953)
* Clear deprecated usages within Prysm * Remove deprecatd usages where possible * Update
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user