github.com/leonlxy/hyperledger@v1.0.0-alpha.0.20170427033203-34922035d248/bddtests/peer/peer_pb2_grpc.py (about)

     1  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
     2  import grpc
     3  from grpc.framework.common import cardinality
     4  from grpc.framework.interfaces.face import utilities as face_utilities
     5  
     6  import peer.proposal_pb2 as peer_dot_proposal__pb2
     7  import peer.proposal_response_pb2 as peer_dot_proposal__response__pb2
     8  
     9  
    10  class EndorserStub(object):
    11  
    12    def __init__(self, channel):
    13      """Constructor.
    14  
    15      Args:
    16        channel: A grpc.Channel.
    17      """
    18      self.ProcessProposal = channel.unary_unary(
    19          '/protos.Endorser/ProcessProposal',
    20          request_serializer=peer_dot_proposal__pb2.SignedProposal.SerializeToString,
    21          response_deserializer=peer_dot_proposal__response__pb2.ProposalResponse.FromString,
    22          )
    23  
    24  
    25  class EndorserServicer(object):
    26  
    27    def ProcessProposal(self, request, context):
    28      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    29      context.set_details('Method not implemented!')
    30      raise NotImplementedError('Method not implemented!')
    31  
    32  
    33  def add_EndorserServicer_to_server(servicer, server):
    34    rpc_method_handlers = {
    35        'ProcessProposal': grpc.unary_unary_rpc_method_handler(
    36            servicer.ProcessProposal,
    37            request_deserializer=peer_dot_proposal__pb2.SignedProposal.FromString,
    38            response_serializer=peer_dot_proposal__response__pb2.ProposalResponse.SerializeToString,
    39        ),
    40    }
    41    generic_handler = grpc.method_handlers_generic_handler(
    42        'protos.Endorser', rpc_method_handlers)
    43    server.add_generic_rpc_handlers((generic_handler,))