# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: Transactor.proto

import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()


import Types_pb2 as Types__pb2


DESCRIPTOR = _descriptor.FileDescriptor(
  name='Transactor.proto',
  package='protocol',
  syntax='proto3',
  serialized_pb=_b('\n\x10Transactor.proto\x12\x08protocol\x1a\x0bTypes.proto\"&\n\rInsertRequest\x12\x15\n\rcanonicalCbor\x18\x01 \x01(\x0c\"&\n\rUpdateRequest\x12\x15\n\rchainCellCbor\x18\x01 \x01(\x0c\"\x16\n\x14JournalStreamRequest\"\xa6\x01\n\x11UpdateChainResult\x12/\n\tcanonical\x18\x01 \x01(\x0b\x32\x1c.protocol.MultihashReference\x12+\n\x05\x63hain\x18\x02 \x01(\x0b\x32\x1c.protocol.MultihashReference\x12\x33\n\rchainPrevious\x18\x03 \x01(\x0b\x32\x1c.protocol.MultihashReference\"\xc9\x01\n\x0cJournalEvent\x12<\n\x14insertCanonicalEvent\x18\x01 \x01(\x0b\x32\x1c.protocol.MultihashReferenceH\x00\x12\x37\n\x10updateChainEvent\x18\x02 \x01(\x0b\x32\x1b.protocol.UpdateChainResultH\x00\x12\x39\n\x11journalBlockEvent\x18\x03 \x01(\x0b\x32\x1c.protocol.MultihashReferenceH\x00\x42\x07\n\x05\x65vent2\xb5\x02\n\x11TransactorService\x12H\n\x0fInsertCanonical\x12\x17.protocol.InsertRequest\x1a\x1c.protocol.MultihashReference\x12\x44\n\x0bUpdateChain\x12\x17.protocol.UpdateRequest\x1a\x1c.protocol.MultihashReference\x12\x45\n\x0bLookupChain\x12\x1c.protocol.MultihashReference\x1a\x18.protocol.ChainReference\x12I\n\rJournalStream\x12\x1e.protocol.JournalStreamRequest\x1a\x16.protocol.JournalEvent0\x01\x42#\n!io.mediachain.protocol.transactorb\x06proto3')
  ,
  dependencies=[Types__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)




_INSERTREQUEST = _descriptor.Descriptor(
  name='InsertRequest',
  full_name='protocol.InsertRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='canonicalCbor', full_name='protocol.InsertRequest.canonicalCbor', index=0,
      number=1, type=12, cpp_type=9, label=1,
      has_default_value=False, default_value=_b(""),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=43,
  serialized_end=81,
)


_UPDATEREQUEST = _descriptor.Descriptor(
  name='UpdateRequest',
  full_name='protocol.UpdateRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='chainCellCbor', full_name='protocol.UpdateRequest.chainCellCbor', index=0,
      number=1, type=12, cpp_type=9, label=1,
      has_default_value=False, default_value=_b(""),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=83,
  serialized_end=121,
)


_JOURNALSTREAMREQUEST = _descriptor.Descriptor(
  name='JournalStreamRequest',
  full_name='protocol.JournalStreamRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=123,
  serialized_end=145,
)


_UPDATECHAINRESULT = _descriptor.Descriptor(
  name='UpdateChainResult',
  full_name='protocol.UpdateChainResult',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='canonical', full_name='protocol.UpdateChainResult.canonical', index=0,
      number=1, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='chain', full_name='protocol.UpdateChainResult.chain', index=1,
      number=2, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='chainPrevious', full_name='protocol.UpdateChainResult.chainPrevious', index=2,
      number=3, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=148,
  serialized_end=314,
)


_JOURNALEVENT = _descriptor.Descriptor(
  name='JournalEvent',
  full_name='protocol.JournalEvent',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='insertCanonicalEvent', full_name='protocol.JournalEvent.insertCanonicalEvent', index=0,
      number=1, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='updateChainEvent', full_name='protocol.JournalEvent.updateChainEvent', index=1,
      number=2, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='journalBlockEvent', full_name='protocol.JournalEvent.journalBlockEvent', index=2,
      number=3, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
    _descriptor.OneofDescriptor(
      name='event', full_name='protocol.JournalEvent.event',
      index=0, containing_type=None, fields=[]),
  ],
  serialized_start=317,
  serialized_end=518,
)

_UPDATECHAINRESULT.fields_by_name['canonical'].message_type = Types__pb2._MULTIHASHREFERENCE
_UPDATECHAINRESULT.fields_by_name['chain'].message_type = Types__pb2._MULTIHASHREFERENCE
_UPDATECHAINRESULT.fields_by_name['chainPrevious'].message_type = Types__pb2._MULTIHASHREFERENCE
_JOURNALEVENT.fields_by_name['insertCanonicalEvent'].message_type = Types__pb2._MULTIHASHREFERENCE
_JOURNALEVENT.fields_by_name['updateChainEvent'].message_type = _UPDATECHAINRESULT
_JOURNALEVENT.fields_by_name['journalBlockEvent'].message_type = Types__pb2._MULTIHASHREFERENCE
_JOURNALEVENT.oneofs_by_name['event'].fields.append(
  _JOURNALEVENT.fields_by_name['insertCanonicalEvent'])
_JOURNALEVENT.fields_by_name['insertCanonicalEvent'].containing_oneof = _JOURNALEVENT.oneofs_by_name['event']
_JOURNALEVENT.oneofs_by_name['event'].fields.append(
  _JOURNALEVENT.fields_by_name['updateChainEvent'])
_JOURNALEVENT.fields_by_name['updateChainEvent'].containing_oneof = _JOURNALEVENT.oneofs_by_name['event']
_JOURNALEVENT.oneofs_by_name['event'].fields.append(
  _JOURNALEVENT.fields_by_name['journalBlockEvent'])
_JOURNALEVENT.fields_by_name['journalBlockEvent'].containing_oneof = _JOURNALEVENT.oneofs_by_name['event']
DESCRIPTOR.message_types_by_name['InsertRequest'] = _INSERTREQUEST
DESCRIPTOR.message_types_by_name['UpdateRequest'] = _UPDATEREQUEST
DESCRIPTOR.message_types_by_name['JournalStreamRequest'] = _JOURNALSTREAMREQUEST
DESCRIPTOR.message_types_by_name['UpdateChainResult'] = _UPDATECHAINRESULT
DESCRIPTOR.message_types_by_name['JournalEvent'] = _JOURNALEVENT

InsertRequest = _reflection.GeneratedProtocolMessageType('InsertRequest', (_message.Message,), dict(
  DESCRIPTOR = _INSERTREQUEST,
  __module__ = 'Transactor_pb2'
  # @@protoc_insertion_point(class_scope:protocol.InsertRequest)
  ))
_sym_db.RegisterMessage(InsertRequest)

UpdateRequest = _reflection.GeneratedProtocolMessageType('UpdateRequest', (_message.Message,), dict(
  DESCRIPTOR = _UPDATEREQUEST,
  __module__ = 'Transactor_pb2'
  # @@protoc_insertion_point(class_scope:protocol.UpdateRequest)
  ))
_sym_db.RegisterMessage(UpdateRequest)

JournalStreamRequest = _reflection.GeneratedProtocolMessageType('JournalStreamRequest', (_message.Message,), dict(
  DESCRIPTOR = _JOURNALSTREAMREQUEST,
  __module__ = 'Transactor_pb2'
  # @@protoc_insertion_point(class_scope:protocol.JournalStreamRequest)
  ))
_sym_db.RegisterMessage(JournalStreamRequest)

UpdateChainResult = _reflection.GeneratedProtocolMessageType('UpdateChainResult', (_message.Message,), dict(
  DESCRIPTOR = _UPDATECHAINRESULT,
  __module__ = 'Transactor_pb2'
  # @@protoc_insertion_point(class_scope:protocol.UpdateChainResult)
  ))
_sym_db.RegisterMessage(UpdateChainResult)

JournalEvent = _reflection.GeneratedProtocolMessageType('JournalEvent', (_message.Message,), dict(
  DESCRIPTOR = _JOURNALEVENT,
  __module__ = 'Transactor_pb2'
  # @@protoc_insertion_point(class_scope:protocol.JournalEvent)
  ))
_sym_db.RegisterMessage(JournalEvent)


DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n!io.mediachain.protocol.transactor'))
import grpc
from grpc.beta import implementations as beta_implementations
from grpc.beta import interfaces as beta_interfaces
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities


class TransactorServiceStub(object):

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

    Args:
      channel: A grpc.Channel.
    """
    self.InsertCanonical = channel.unary_unary(
        '/protocol.TransactorService/InsertCanonical',
        request_serializer=InsertRequest.SerializeToString,
        response_deserializer=Types__pb2.MultihashReference.FromString,
        )
    self.UpdateChain = channel.unary_unary(
        '/protocol.TransactorService/UpdateChain',
        request_serializer=UpdateRequest.SerializeToString,
        response_deserializer=Types__pb2.MultihashReference.FromString,
        )
    self.LookupChain = channel.unary_unary(
        '/protocol.TransactorService/LookupChain',
        request_serializer=Types__pb2.MultihashReference.SerializeToString,
        response_deserializer=Types__pb2.ChainReference.FromString,
        )
    self.JournalStream = channel.unary_stream(
        '/protocol.TransactorService/JournalStream',
        request_serializer=JournalStreamRequest.SerializeToString,
        response_deserializer=JournalEvent.FromString,
        )


class TransactorServiceServicer(object):

  def InsertCanonical(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def UpdateChain(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def LookupChain(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def JournalStream(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TransactorServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'InsertCanonical': grpc.unary_unary_rpc_method_handler(
          servicer.InsertCanonical,
          request_deserializer=InsertRequest.FromString,
          response_serializer=Types__pb2.MultihashReference.SerializeToString,
      ),
      'UpdateChain': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateChain,
          request_deserializer=UpdateRequest.FromString,
          response_serializer=Types__pb2.MultihashReference.SerializeToString,
      ),
      'LookupChain': grpc.unary_unary_rpc_method_handler(
          servicer.LookupChain,
          request_deserializer=Types__pb2.MultihashReference.FromString,
          response_serializer=Types__pb2.ChainReference.SerializeToString,
      ),
      'JournalStream': grpc.unary_stream_rpc_method_handler(
          servicer.JournalStream,
          request_deserializer=JournalStreamRequest.FromString,
          response_serializer=JournalEvent.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'protocol.TransactorService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))


class BetaTransactorServiceServicer(object):
  def InsertCanonical(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
  def UpdateChain(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
  def LookupChain(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
  def JournalStream(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)


class BetaTransactorServiceStub(object):
  def InsertCanonical(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()
  InsertCanonical.future = None
  def UpdateChain(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()
  UpdateChain.future = None
  def LookupChain(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()
  LookupChain.future = None
  def JournalStream(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()


def beta_create_TransactorService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  request_deserializers = {
    ('protocol.TransactorService', 'InsertCanonical'): InsertRequest.FromString,
    ('protocol.TransactorService', 'JournalStream'): JournalStreamRequest.FromString,
    ('protocol.TransactorService', 'LookupChain'): Types__pb2.MultihashReference.FromString,
    ('protocol.TransactorService', 'UpdateChain'): UpdateRequest.FromString,
  }
  response_serializers = {
    ('protocol.TransactorService', 'InsertCanonical'): Types__pb2.MultihashReference.SerializeToString,
    ('protocol.TransactorService', 'JournalStream'): JournalEvent.SerializeToString,
    ('protocol.TransactorService', 'LookupChain'): Types__pb2.ChainReference.SerializeToString,
    ('protocol.TransactorService', 'UpdateChain'): Types__pb2.MultihashReference.SerializeToString,
  }
  method_implementations = {
    ('protocol.TransactorService', 'InsertCanonical'): face_utilities.unary_unary_inline(servicer.InsertCanonical),
    ('protocol.TransactorService', 'JournalStream'): face_utilities.unary_stream_inline(servicer.JournalStream),
    ('protocol.TransactorService', 'LookupChain'): face_utilities.unary_unary_inline(servicer.LookupChain),
    ('protocol.TransactorService', 'UpdateChain'): face_utilities.unary_unary_inline(servicer.UpdateChain),
  }
  server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
  return beta_implementations.server(method_implementations, options=server_options)


def beta_create_TransactorService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
  request_serializers = {
    ('protocol.TransactorService', 'InsertCanonical'): InsertRequest.SerializeToString,
    ('protocol.TransactorService', 'JournalStream'): JournalStreamRequest.SerializeToString,
    ('protocol.TransactorService', 'LookupChain'): Types__pb2.MultihashReference.SerializeToString,
    ('protocol.TransactorService', 'UpdateChain'): UpdateRequest.SerializeToString,
  }
  response_deserializers = {
    ('protocol.TransactorService', 'InsertCanonical'): Types__pb2.MultihashReference.FromString,
    ('protocol.TransactorService', 'JournalStream'): JournalEvent.FromString,
    ('protocol.TransactorService', 'LookupChain'): Types__pb2.ChainReference.FromString,
    ('protocol.TransactorService', 'UpdateChain'): Types__pb2.MultihashReference.FromString,
  }
  cardinalities = {
    'InsertCanonical': cardinality.Cardinality.UNARY_UNARY,
    'JournalStream': cardinality.Cardinality.UNARY_STREAM,
    'LookupChain': cardinality.Cardinality.UNARY_UNARY,
    'UpdateChain': cardinality.Cardinality.UNARY_UNARY,
  }
  stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
  return beta_implementations.dynamic_stub(channel, 'protocol.TransactorService', cardinalities, options=stub_options)
# @@protoc_insertion_point(module_scope)
