mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
7c49277e83
* WIP * WIP * Remove duplicate mock * WIP * Revert "WIP" This reverts commit a8010057fef4209dfddde34ea868b88f1e196c44. * Fix build break * Remove unused variable * Fix build break * Rename validator_mock to validatormock * Fix failing test --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
51 lines
1.6 KiB
Go
51 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 grpcNodeClient struct {
|
|
nodeClient ethpb.NodeClient
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) {
|
|
return c.nodeClient.GetSyncStatus(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) {
|
|
return c.nodeClient.GetGenesis(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) {
|
|
return c.nodeClient.GetVersion(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) ListImplementedServices(ctx context.Context, in *empty.Empty) (*ethpb.ImplementedServices, error) {
|
|
return c.nodeClient.ListImplementedServices(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetHost(ctx context.Context, in *empty.Empty) (*ethpb.HostData, error) {
|
|
return c.nodeClient.GetHost(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetPeer(ctx context.Context, in *ethpb.PeerRequest) (*ethpb.Peer, error) {
|
|
return c.nodeClient.GetPeer(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) {
|
|
return c.nodeClient.ListPeers(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetETH1ConnectionStatus(ctx context.Context, in *empty.Empty) (*ethpb.ETH1ConnectionStatus, error) {
|
|
return c.nodeClient.GetETH1ConnectionStatus(ctx, in)
|
|
}
|
|
|
|
func NewNodeClient(cc grpc.ClientConnInterface) iface.NodeClient {
|
|
return &grpcNodeClient{ethpb.NewNodeClient(cc)}
|
|
}
|