//
//validator_api.proto defines the gRPC service interface for the Bitcoin SV transaction
//validation service. It specifies the methods and message types for transaction
//validation, health checking, and block information retrieval.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.32.1
// source: services/validator/validator_api/validator_api.proto

package validator_api

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ValidatorAPI_HealthGRPC_FullMethodName               = "/validator_api.ValidatorAPI/HealthGRPC"
	ValidatorAPI_ValidateTransaction_FullMethodName      = "/validator_api.ValidatorAPI/ValidateTransaction"
	ValidatorAPI_ValidateTransactionBatch_FullMethodName = "/validator_api.ValidatorAPI/ValidateTransactionBatch"
	ValidatorAPI_GetBlockHeight_FullMethodName           = "/validator_api.ValidatorAPI/GetBlockHeight"
	ValidatorAPI_GetMedianBlockTime_FullMethodName       = "/validator_api.ValidatorAPI/GetMedianBlockTime"
)

// ValidatorAPIClient is the client API for ValidatorAPI service.
//
// 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.
//
// ValidatorAPI service provides methods for transaction validation and related operations
type ValidatorAPIClient interface {
	// HealthGRPC checks the health status of the validation service
	// Returns detailed health information including service status and timestamp
	HealthGRPC(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*HealthResponse, error)
	// ValidateTransaction validates a single transaction
	// Performs comprehensive validation including script verification and UTXO checks
	ValidateTransaction(ctx context.Context, in *ValidateTransactionRequest, opts ...grpc.CallOption) (*ValidateTransactionResponse, error)
	// ValidateTransactionBatch validates multiple transactions in a single request
	// Provides efficient batch processing of transactions
	ValidateTransactionBatch(ctx context.Context, in *ValidateTransactionBatchRequest, opts ...grpc.CallOption) (*ValidateTransactionBatchResponse, error)
	// GetBlockHeight retrieves the current block height
	// Used for validation context and protocol upgrade determination
	GetBlockHeight(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*GetBlockHeightResponse, error)
	// GetMedianBlockTime retrieves the median time of recent blocks
	// Used for time-based validation rules
	GetMedianBlockTime(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*GetMedianBlockTimeResponse, error)
}

type validatorAPIClient struct {
	cc grpc.ClientConnInterface
}

func NewValidatorAPIClient(cc grpc.ClientConnInterface) ValidatorAPIClient {
	return &validatorAPIClient{cc}
}

func (c *validatorAPIClient) HealthGRPC(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*HealthResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HealthResponse)
	err := c.cc.Invoke(ctx, ValidatorAPI_HealthGRPC_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *validatorAPIClient) ValidateTransaction(ctx context.Context, in *ValidateTransactionRequest, opts ...grpc.CallOption) (*ValidateTransactionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ValidateTransactionResponse)
	err := c.cc.Invoke(ctx, ValidatorAPI_ValidateTransaction_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *validatorAPIClient) ValidateTransactionBatch(ctx context.Context, in *ValidateTransactionBatchRequest, opts ...grpc.CallOption) (*ValidateTransactionBatchResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ValidateTransactionBatchResponse)
	err := c.cc.Invoke(ctx, ValidatorAPI_ValidateTransactionBatch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *validatorAPIClient) GetBlockHeight(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*GetBlockHeightResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetBlockHeightResponse)
	err := c.cc.Invoke(ctx, ValidatorAPI_GetBlockHeight_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *validatorAPIClient) GetMedianBlockTime(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*GetMedianBlockTimeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetMedianBlockTimeResponse)
	err := c.cc.Invoke(ctx, ValidatorAPI_GetMedianBlockTime_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ValidatorAPIServer is the server API for ValidatorAPI service.
// All implementations must embed UnimplementedValidatorAPIServer
// for forward compatibility.
//
// ValidatorAPI service provides methods for transaction validation and related operations
type ValidatorAPIServer interface {
	// HealthGRPC checks the health status of the validation service
	// Returns detailed health information including service status and timestamp
	HealthGRPC(context.Context, *EmptyMessage) (*HealthResponse, error)
	// ValidateTransaction validates a single transaction
	// Performs comprehensive validation including script verification and UTXO checks
	ValidateTransaction(context.Context, *ValidateTransactionRequest) (*ValidateTransactionResponse, error)
	// ValidateTransactionBatch validates multiple transactions in a single request
	// Provides efficient batch processing of transactions
	ValidateTransactionBatch(context.Context, *ValidateTransactionBatchRequest) (*ValidateTransactionBatchResponse, error)
	// GetBlockHeight retrieves the current block height
	// Used for validation context and protocol upgrade determination
	GetBlockHeight(context.Context, *EmptyMessage) (*GetBlockHeightResponse, error)
	// GetMedianBlockTime retrieves the median time of recent blocks
	// Used for time-based validation rules
	GetMedianBlockTime(context.Context, *EmptyMessage) (*GetMedianBlockTimeResponse, error)
	mustEmbedUnimplementedValidatorAPIServer()
}

// UnimplementedValidatorAPIServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedValidatorAPIServer struct{}

func (UnimplementedValidatorAPIServer) HealthGRPC(context.Context, *EmptyMessage) (*HealthResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method HealthGRPC not implemented")
}
func (UnimplementedValidatorAPIServer) ValidateTransaction(context.Context, *ValidateTransactionRequest) (*ValidateTransactionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ValidateTransaction not implemented")
}
func (UnimplementedValidatorAPIServer) ValidateTransactionBatch(context.Context, *ValidateTransactionBatchRequest) (*ValidateTransactionBatchResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ValidateTransactionBatch not implemented")
}
func (UnimplementedValidatorAPIServer) GetBlockHeight(context.Context, *EmptyMessage) (*GetBlockHeightResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetBlockHeight not implemented")
}
func (UnimplementedValidatorAPIServer) GetMedianBlockTime(context.Context, *EmptyMessage) (*GetMedianBlockTimeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetMedianBlockTime not implemented")
}
func (UnimplementedValidatorAPIServer) mustEmbedUnimplementedValidatorAPIServer() {}
func (UnimplementedValidatorAPIServer) testEmbeddedByValue()                      {}

// UnsafeValidatorAPIServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ValidatorAPIServer will
// result in compilation errors.
type UnsafeValidatorAPIServer interface {
	mustEmbedUnimplementedValidatorAPIServer()
}

func RegisterValidatorAPIServer(s grpc.ServiceRegistrar, srv ValidatorAPIServer) {
	// If the following call pancis, it indicates UnimplementedValidatorAPIServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&ValidatorAPI_ServiceDesc, srv)
}

func _ValidatorAPI_HealthGRPC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMessage)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ValidatorAPIServer).HealthGRPC(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ValidatorAPI_HealthGRPC_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ValidatorAPIServer).HealthGRPC(ctx, req.(*EmptyMessage))
	}
	return interceptor(ctx, in, info, handler)
}

func _ValidatorAPI_ValidateTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ValidateTransactionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ValidatorAPIServer).ValidateTransaction(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ValidatorAPI_ValidateTransaction_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ValidatorAPIServer).ValidateTransaction(ctx, req.(*ValidateTransactionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ValidatorAPI_ValidateTransactionBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ValidateTransactionBatchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ValidatorAPIServer).ValidateTransactionBatch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ValidatorAPI_ValidateTransactionBatch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ValidatorAPIServer).ValidateTransactionBatch(ctx, req.(*ValidateTransactionBatchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ValidatorAPI_GetBlockHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMessage)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ValidatorAPIServer).GetBlockHeight(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ValidatorAPI_GetBlockHeight_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ValidatorAPIServer).GetBlockHeight(ctx, req.(*EmptyMessage))
	}
	return interceptor(ctx, in, info, handler)
}

func _ValidatorAPI_GetMedianBlockTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMessage)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ValidatorAPIServer).GetMedianBlockTime(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ValidatorAPI_GetMedianBlockTime_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ValidatorAPIServer).GetMedianBlockTime(ctx, req.(*EmptyMessage))
	}
	return interceptor(ctx, in, info, handler)
}

// ValidatorAPI_ServiceDesc is the grpc.ServiceDesc for ValidatorAPI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ValidatorAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "validator_api.ValidatorAPI",
	HandlerType: (*ValidatorAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "HealthGRPC",
			Handler:    _ValidatorAPI_HealthGRPC_Handler,
		},
		{
			MethodName: "ValidateTransaction",
			Handler:    _ValidatorAPI_ValidateTransaction_Handler,
		},
		{
			MethodName: "ValidateTransactionBatch",
			Handler:    _ValidatorAPI_ValidateTransactionBatch_Handler,
		},
		{
			MethodName: "GetBlockHeight",
			Handler:    _ValidatorAPI_GetBlockHeight_Handler,
		},
		{
			MethodName: "GetMedianBlockTime",
			Handler:    _ValidatorAPI_GetMedianBlockTime_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/validator/validator_api/validator_api.proto",
}
