# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import CasperMessage_pb2 as CasperMessage__pb2
from . import DeployService_pb2 as DeployService__pb2
from . import Either_pb2 as Either__pb2


class DeployServiceStub(object):
  """Use `DoDeploy` to queue deployments of Rholang code and then
  `createBlock` to make a new block with the results of running them
  all.

  To get results back, use `listenForDataAtName`.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.DoDeploy = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/DoDeploy',
        request_serializer=CasperMessage__pb2.DeployData.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.getBlock = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/getBlock',
        request_serializer=DeployService__pb2.BlockQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.visualizeDag = channel.unary_stream(
        '/coop.rchain.casper.protocol.DeployService/visualizeDag',
        request_serializer=DeployService__pb2.VisualizeDagQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.machineVerifiableDag = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/machineVerifiableDag',
        request_serializer=DeployService__pb2.MachineVerifyQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.showMainChain = channel.unary_stream(
        '/coop.rchain.casper.protocol.DeployService/showMainChain',
        request_serializer=DeployService__pb2.BlocksQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.getBlocks = channel.unary_stream(
        '/coop.rchain.casper.protocol.DeployService/getBlocks',
        request_serializer=DeployService__pb2.BlocksQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.listenForDataAtName = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/listenForDataAtName',
        request_serializer=DeployService__pb2.DataAtNameQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.listenForContinuationAtName = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/listenForContinuationAtName',
        request_serializer=DeployService__pb2.ContinuationAtNameQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.findBlockWithDeploy = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/findBlockWithDeploy',
        request_serializer=DeployService__pb2.FindDeployInBlockQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.findDeploy = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/findDeploy',
        request_serializer=DeployService__pb2.FindDeployQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.previewPrivateNames = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/previewPrivateNames',
        request_serializer=DeployService__pb2.PrivateNamePreviewQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )
    self.lastFinalizedBlock = channel.unary_unary(
        '/coop.rchain.casper.protocol.DeployService/lastFinalizedBlock',
        request_serializer=DeployService__pb2.LastFinalizedBlockQuery.SerializeToString,
        response_deserializer=Either__pb2.Either.FromString,
        )


class DeployServiceServicer(object):
  """Use `DoDeploy` to queue deployments of Rholang code and then
  `createBlock` to make a new block with the results of running them
  all.

  To get results back, use `listenForDataAtName`.
  """

  def DoDeploy(self, request, context):
    """Queue deployment of Rholang code (or fail to parse).
    Returns on success DeployServiceResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def getBlock(self, request, context):
    """Get details about a particular block.
    Returns on success BlockQueryResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def visualizeDag(self, request, context):
    """Get dag
    Returns on success VisualizeBlocksResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def machineVerifiableDag(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def showMainChain(self, request, context):
    """Returns on success LightBlockInfo
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def getBlocks(self, request, context):
    """Get a summary of blocks on the blockchain.
    Returns on success LightBlockInfo
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def listenForDataAtName(self, request, context):
    """Find data sent to a name.
    Returns on success ListeningNameDataResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def listenForContinuationAtName(self, request, context):
    """Find processes receiving on a name.
    Returns on success ListeningNameContinuationResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def findBlockWithDeploy(self, request, context):
    """Find block from a deploy.
    Returns on success BlockQueryResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def findDeploy(self, request, context):
    """Find block containing a deploy.
    Returns on success LightBlockQueryResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def previewPrivateNames(self, request, context):
    """Preview new top-level unforgeable names (for example, to compute signatures over them).
    Returns on success PrivateNamePreviewResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def lastFinalizedBlock(self, request, context):
    """Get details about a particular block.
    Returns on success BlockQueryResponse
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_DeployServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'DoDeploy': grpc.unary_unary_rpc_method_handler(
          servicer.DoDeploy,
          request_deserializer=CasperMessage__pb2.DeployData.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'getBlock': grpc.unary_unary_rpc_method_handler(
          servicer.getBlock,
          request_deserializer=DeployService__pb2.BlockQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'visualizeDag': grpc.unary_stream_rpc_method_handler(
          servicer.visualizeDag,
          request_deserializer=DeployService__pb2.VisualizeDagQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'machineVerifiableDag': grpc.unary_unary_rpc_method_handler(
          servicer.machineVerifiableDag,
          request_deserializer=DeployService__pb2.MachineVerifyQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'showMainChain': grpc.unary_stream_rpc_method_handler(
          servicer.showMainChain,
          request_deserializer=DeployService__pb2.BlocksQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'getBlocks': grpc.unary_stream_rpc_method_handler(
          servicer.getBlocks,
          request_deserializer=DeployService__pb2.BlocksQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'listenForDataAtName': grpc.unary_unary_rpc_method_handler(
          servicer.listenForDataAtName,
          request_deserializer=DeployService__pb2.DataAtNameQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'listenForContinuationAtName': grpc.unary_unary_rpc_method_handler(
          servicer.listenForContinuationAtName,
          request_deserializer=DeployService__pb2.ContinuationAtNameQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'findBlockWithDeploy': grpc.unary_unary_rpc_method_handler(
          servicer.findBlockWithDeploy,
          request_deserializer=DeployService__pb2.FindDeployInBlockQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'findDeploy': grpc.unary_unary_rpc_method_handler(
          servicer.findDeploy,
          request_deserializer=DeployService__pb2.FindDeployQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'previewPrivateNames': grpc.unary_unary_rpc_method_handler(
          servicer.previewPrivateNames,
          request_deserializer=DeployService__pb2.PrivateNamePreviewQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
      'lastFinalizedBlock': grpc.unary_unary_rpc_method_handler(
          servicer.lastFinalizedBlock,
          request_deserializer=DeployService__pb2.LastFinalizedBlockQuery.FromString,
          response_serializer=Either__pb2.Either.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'coop.rchain.casper.protocol.DeployService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
