github.com/MetalBlockchain/metalgo@v1.11.9/proto/pb/validatorstate/validator_state_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             (unknown)
     5  // source: validatorstate/validator_state.proto
     6  
     7  package validatorstate
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    15  )
    16  
    17  // This is a compile-time assertion to ensure that this generated file
    18  // is compatible with the grpc package it is being compiled against.
    19  // Requires gRPC-Go v1.32.0 or later.
    20  const _ = grpc.SupportPackageIsVersion7
    21  
    22  const (
    23  	ValidatorState_GetMinimumHeight_FullMethodName = "/validatorstate.ValidatorState/GetMinimumHeight"
    24  	ValidatorState_GetCurrentHeight_FullMethodName = "/validatorstate.ValidatorState/GetCurrentHeight"
    25  	ValidatorState_GetSubnetID_FullMethodName      = "/validatorstate.ValidatorState/GetSubnetID"
    26  	ValidatorState_GetValidatorSet_FullMethodName  = "/validatorstate.ValidatorState/GetValidatorSet"
    27  )
    28  
    29  // ValidatorStateClient is the client API for ValidatorState service.
    30  //
    31  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    32  type ValidatorStateClient interface {
    33  	// GetMinimumHeight returns the minimum height of the blocks in the optimal
    34  	// proposal window.
    35  	GetMinimumHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMinimumHeightResponse, error)
    36  	// GetCurrentHeight returns the current height of the P-chain.
    37  	GetCurrentHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetCurrentHeightResponse, error)
    38  	// GetSubnetID returns the subnetID of the provided chain.
    39  	GetSubnetID(ctx context.Context, in *GetSubnetIDRequest, opts ...grpc.CallOption) (*GetSubnetIDResponse, error)
    40  	// GetValidatorSet returns the weights of the nodeIDs for the provided
    41  	// subnet at the requested P-chain height.
    42  	GetValidatorSet(ctx context.Context, in *GetValidatorSetRequest, opts ...grpc.CallOption) (*GetValidatorSetResponse, error)
    43  }
    44  
    45  type validatorStateClient struct {
    46  	cc grpc.ClientConnInterface
    47  }
    48  
    49  func NewValidatorStateClient(cc grpc.ClientConnInterface) ValidatorStateClient {
    50  	return &validatorStateClient{cc}
    51  }
    52  
    53  func (c *validatorStateClient) GetMinimumHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMinimumHeightResponse, error) {
    54  	out := new(GetMinimumHeightResponse)
    55  	err := c.cc.Invoke(ctx, ValidatorState_GetMinimumHeight_FullMethodName, in, out, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return out, nil
    60  }
    61  
    62  func (c *validatorStateClient) GetCurrentHeight(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetCurrentHeightResponse, error) {
    63  	out := new(GetCurrentHeightResponse)
    64  	err := c.cc.Invoke(ctx, ValidatorState_GetCurrentHeight_FullMethodName, in, out, opts...)
    65  	if err != nil {
    66  		return nil, err
    67  	}
    68  	return out, nil
    69  }
    70  
    71  func (c *validatorStateClient) GetSubnetID(ctx context.Context, in *GetSubnetIDRequest, opts ...grpc.CallOption) (*GetSubnetIDResponse, error) {
    72  	out := new(GetSubnetIDResponse)
    73  	err := c.cc.Invoke(ctx, ValidatorState_GetSubnetID_FullMethodName, in, out, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return out, nil
    78  }
    79  
    80  func (c *validatorStateClient) GetValidatorSet(ctx context.Context, in *GetValidatorSetRequest, opts ...grpc.CallOption) (*GetValidatorSetResponse, error) {
    81  	out := new(GetValidatorSetResponse)
    82  	err := c.cc.Invoke(ctx, ValidatorState_GetValidatorSet_FullMethodName, in, out, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return out, nil
    87  }
    88  
    89  // ValidatorStateServer is the server API for ValidatorState service.
    90  // All implementations must embed UnimplementedValidatorStateServer
    91  // for forward compatibility
    92  type ValidatorStateServer interface {
    93  	// GetMinimumHeight returns the minimum height of the blocks in the optimal
    94  	// proposal window.
    95  	GetMinimumHeight(context.Context, *emptypb.Empty) (*GetMinimumHeightResponse, error)
    96  	// GetCurrentHeight returns the current height of the P-chain.
    97  	GetCurrentHeight(context.Context, *emptypb.Empty) (*GetCurrentHeightResponse, error)
    98  	// GetSubnetID returns the subnetID of the provided chain.
    99  	GetSubnetID(context.Context, *GetSubnetIDRequest) (*GetSubnetIDResponse, error)
   100  	// GetValidatorSet returns the weights of the nodeIDs for the provided
   101  	// subnet at the requested P-chain height.
   102  	GetValidatorSet(context.Context, *GetValidatorSetRequest) (*GetValidatorSetResponse, error)
   103  	mustEmbedUnimplementedValidatorStateServer()
   104  }
   105  
   106  // UnimplementedValidatorStateServer must be embedded to have forward compatible implementations.
   107  type UnimplementedValidatorStateServer struct {
   108  }
   109  
   110  func (UnimplementedValidatorStateServer) GetMinimumHeight(context.Context, *emptypb.Empty) (*GetMinimumHeightResponse, error) {
   111  	return nil, status.Errorf(codes.Unimplemented, "method GetMinimumHeight not implemented")
   112  }
   113  func (UnimplementedValidatorStateServer) GetCurrentHeight(context.Context, *emptypb.Empty) (*GetCurrentHeightResponse, error) {
   114  	return nil, status.Errorf(codes.Unimplemented, "method GetCurrentHeight not implemented")
   115  }
   116  func (UnimplementedValidatorStateServer) GetSubnetID(context.Context, *GetSubnetIDRequest) (*GetSubnetIDResponse, error) {
   117  	return nil, status.Errorf(codes.Unimplemented, "method GetSubnetID not implemented")
   118  }
   119  func (UnimplementedValidatorStateServer) GetValidatorSet(context.Context, *GetValidatorSetRequest) (*GetValidatorSetResponse, error) {
   120  	return nil, status.Errorf(codes.Unimplemented, "method GetValidatorSet not implemented")
   121  }
   122  func (UnimplementedValidatorStateServer) mustEmbedUnimplementedValidatorStateServer() {}
   123  
   124  // UnsafeValidatorStateServer may be embedded to opt out of forward compatibility for this service.
   125  // Use of this interface is not recommended, as added methods to ValidatorStateServer will
   126  // result in compilation errors.
   127  type UnsafeValidatorStateServer interface {
   128  	mustEmbedUnimplementedValidatorStateServer()
   129  }
   130  
   131  func RegisterValidatorStateServer(s grpc.ServiceRegistrar, srv ValidatorStateServer) {
   132  	s.RegisterService(&ValidatorState_ServiceDesc, srv)
   133  }
   134  
   135  func _ValidatorState_GetMinimumHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   136  	in := new(emptypb.Empty)
   137  	if err := dec(in); err != nil {
   138  		return nil, err
   139  	}
   140  	if interceptor == nil {
   141  		return srv.(ValidatorStateServer).GetMinimumHeight(ctx, in)
   142  	}
   143  	info := &grpc.UnaryServerInfo{
   144  		Server:     srv,
   145  		FullMethod: ValidatorState_GetMinimumHeight_FullMethodName,
   146  	}
   147  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   148  		return srv.(ValidatorStateServer).GetMinimumHeight(ctx, req.(*emptypb.Empty))
   149  	}
   150  	return interceptor(ctx, in, info, handler)
   151  }
   152  
   153  func _ValidatorState_GetCurrentHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   154  	in := new(emptypb.Empty)
   155  	if err := dec(in); err != nil {
   156  		return nil, err
   157  	}
   158  	if interceptor == nil {
   159  		return srv.(ValidatorStateServer).GetCurrentHeight(ctx, in)
   160  	}
   161  	info := &grpc.UnaryServerInfo{
   162  		Server:     srv,
   163  		FullMethod: ValidatorState_GetCurrentHeight_FullMethodName,
   164  	}
   165  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   166  		return srv.(ValidatorStateServer).GetCurrentHeight(ctx, req.(*emptypb.Empty))
   167  	}
   168  	return interceptor(ctx, in, info, handler)
   169  }
   170  
   171  func _ValidatorState_GetSubnetID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   172  	in := new(GetSubnetIDRequest)
   173  	if err := dec(in); err != nil {
   174  		return nil, err
   175  	}
   176  	if interceptor == nil {
   177  		return srv.(ValidatorStateServer).GetSubnetID(ctx, in)
   178  	}
   179  	info := &grpc.UnaryServerInfo{
   180  		Server:     srv,
   181  		FullMethod: ValidatorState_GetSubnetID_FullMethodName,
   182  	}
   183  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   184  		return srv.(ValidatorStateServer).GetSubnetID(ctx, req.(*GetSubnetIDRequest))
   185  	}
   186  	return interceptor(ctx, in, info, handler)
   187  }
   188  
   189  func _ValidatorState_GetValidatorSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   190  	in := new(GetValidatorSetRequest)
   191  	if err := dec(in); err != nil {
   192  		return nil, err
   193  	}
   194  	if interceptor == nil {
   195  		return srv.(ValidatorStateServer).GetValidatorSet(ctx, in)
   196  	}
   197  	info := &grpc.UnaryServerInfo{
   198  		Server:     srv,
   199  		FullMethod: ValidatorState_GetValidatorSet_FullMethodName,
   200  	}
   201  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   202  		return srv.(ValidatorStateServer).GetValidatorSet(ctx, req.(*GetValidatorSetRequest))
   203  	}
   204  	return interceptor(ctx, in, info, handler)
   205  }
   206  
   207  // ValidatorState_ServiceDesc is the grpc.ServiceDesc for ValidatorState service.
   208  // It's only intended for direct use with grpc.RegisterService,
   209  // and not to be introspected or modified (even as a copy)
   210  var ValidatorState_ServiceDesc = grpc.ServiceDesc{
   211  	ServiceName: "validatorstate.ValidatorState",
   212  	HandlerType: (*ValidatorStateServer)(nil),
   213  	Methods: []grpc.MethodDesc{
   214  		{
   215  			MethodName: "GetMinimumHeight",
   216  			Handler:    _ValidatorState_GetMinimumHeight_Handler,
   217  		},
   218  		{
   219  			MethodName: "GetCurrentHeight",
   220  			Handler:    _ValidatorState_GetCurrentHeight_Handler,
   221  		},
   222  		{
   223  			MethodName: "GetSubnetID",
   224  			Handler:    _ValidatorState_GetSubnetID_Handler,
   225  		},
   226  		{
   227  			MethodName: "GetValidatorSet",
   228  			Handler:    _ValidatorState_GetValidatorSet_Handler,
   229  		},
   230  	},
   231  	Streams:  []grpc.StreamDesc{},
   232  	Metadata: "validatorstate/validator_state.proto",
   233  }