github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/bddtests/peer/chaincode_pb2_grpc.py (about)

     1  import grpc
     2  from grpc.framework.common import cardinality
     3  from grpc.framework.interfaces.face import utilities as face_utilities
     4  
     5  import peer.chaincode_pb2 as peer_dot_chaincode__pb2
     6  import peer.chaincode_pb2 as peer_dot_chaincode__pb2
     7  
     8  
     9  class ChaincodeSupportStub(object):
    10    """Interface that provides support to chaincode execution. ChaincodeContext
    11    provides the context necessary for the server to respond appropriately.
    12    """
    13  
    14    def __init__(self, channel):
    15      """Constructor.
    16  
    17      Args:
    18        channel: A grpc.Channel.
    19      """
    20      self.Register = channel.stream_stream(
    21          '/protos.ChaincodeSupport/Register',
    22          request_serializer=peer_dot_chaincode__pb2.ChaincodeMessage.SerializeToString,
    23          response_deserializer=peer_dot_chaincode__pb2.ChaincodeMessage.FromString,
    24          )
    25  
    26  
    27  class ChaincodeSupportServicer(object):
    28    """Interface that provides support to chaincode execution. ChaincodeContext
    29    provides the context necessary for the server to respond appropriately.
    30    """
    31  
    32    def Register(self, request_iterator, context):
    33      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    34      context.set_details('Method not implemented!')
    35      raise NotImplementedError('Method not implemented!')
    36  
    37  
    38  def add_ChaincodeSupportServicer_to_server(servicer, server):
    39    rpc_method_handlers = {
    40        'Register': grpc.stream_stream_rpc_method_handler(
    41            servicer.Register,
    42            request_deserializer=peer_dot_chaincode__pb2.ChaincodeMessage.FromString,
    43            response_serializer=peer_dot_chaincode__pb2.ChaincodeMessage.SerializeToString,
    44        ),
    45    }
    46    generic_handler = grpc.method_handlers_generic_handler(
    47        'protos.ChaincodeSupport', rpc_method_handlers)
    48    server.add_generic_rpc_handlers((generic_handler,))