# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from utxorpc_spec.utxorpc.v1alpha.submit import submit_pb2 as utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2


class SubmitServiceStub(object):
    """Service definition for submitting transactions and checking their status.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.EvalTx = channel.unary_unary(
                '/utxorpc.v1alpha.submit.SubmitService/EvalTx',
                request_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxResponse.FromString,
                _registered_method=True)
        self.SubmitTx = channel.unary_unary(
                '/utxorpc.v1alpha.submit.SubmitService/SubmitTx',
                request_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxResponse.FromString,
                _registered_method=True)
        self.WaitForTx = channel.unary_stream(
                '/utxorpc.v1alpha.submit.SubmitService/WaitForTx',
                request_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxResponse.FromString,
                _registered_method=True)
        self.ReadMempool = channel.unary_unary(
                '/utxorpc.v1alpha.submit.SubmitService/ReadMempool',
                request_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolResponse.FromString,
                _registered_method=True)
        self.WatchMempool = channel.unary_stream(
                '/utxorpc.v1alpha.submit.SubmitService/WatchMempool',
                request_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolResponse.FromString,
                _registered_method=True)


class SubmitServiceServicer(object):
    """Service definition for submitting transactions and checking their status.
    """

    def EvalTx(self, request, context):
        """Evaluates a transaction without submitting it.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubmitTx(self, request, context):
        """Submit transactions to the blockchain.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WaitForTx(self, request, context):
        """Wait for transactions to reach a certain stage and stream the updates.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadMempool(self, request, context):
        """Returns a point-in-time snapshot of the mempool.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WatchMempool(self, request, context):
        """Stream transactions from the mempool matching the specified predicates.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SubmitServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'EvalTx': grpc.unary_unary_rpc_method_handler(
                    servicer.EvalTx,
                    request_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxResponse.SerializeToString,
            ),
            'SubmitTx': grpc.unary_unary_rpc_method_handler(
                    servicer.SubmitTx,
                    request_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxResponse.SerializeToString,
            ),
            'WaitForTx': grpc.unary_stream_rpc_method_handler(
                    servicer.WaitForTx,
                    request_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxResponse.SerializeToString,
            ),
            'ReadMempool': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadMempool,
                    request_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolResponse.SerializeToString,
            ),
            'WatchMempool': grpc.unary_stream_rpc_method_handler(
                    servicer.WatchMempool,
                    request_deserializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'utxorpc.v1alpha.submit.SubmitService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('utxorpc.v1alpha.submit.SubmitService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SubmitService(object):
    """Service definition for submitting transactions and checking their status.
    """

    @staticmethod
    def EvalTx(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/utxorpc.v1alpha.submit.SubmitService/EvalTx',
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.EvalTxResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubmitTx(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/utxorpc.v1alpha.submit.SubmitService/SubmitTx',
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.SubmitTxResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WaitForTx(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/utxorpc.v1alpha.submit.SubmitService/WaitForTx',
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WaitForTxResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadMempool(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/utxorpc.v1alpha.submit.SubmitService/ReadMempool',
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.ReadMempoolResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WatchMempool(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/utxorpc.v1alpha.submit.SubmitService/WatchMempool',
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_submit_dot_submit__pb2.WatchMempoolResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
