mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
c0ee781638
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
43 lines
1.6 KiB
Go
43 lines
1.6 KiB
Go
package grpc_api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v4/validator/client/iface"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type grpcBeaconChainClient struct {
|
|
beaconChainClient ethpb.BeaconChainClient
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) {
|
|
return c.beaconChainClient.GetChainHead(ctx, in)
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) {
|
|
return c.beaconChainClient.ListValidatorBalances(ctx, in)
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) {
|
|
return c.beaconChainClient.ListValidators(ctx, in)
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) {
|
|
return c.beaconChainClient.GetValidatorQueue(ctx, in)
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) {
|
|
return c.beaconChainClient.GetValidatorPerformance(ctx, in)
|
|
}
|
|
|
|
func (c *grpcBeaconChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) {
|
|
return c.beaconChainClient.GetValidatorParticipation(ctx, in)
|
|
}
|
|
|
|
func NewGrpcBeaconChainClient(cc grpc.ClientConnInterface) iface.BeaconChainClient {
|
|
return &grpcBeaconChainClient{ethpb.NewBeaconChainClient(cc)}
|
|
}
|