Exemplo n.º 1
0
    def inspect_node(self, index):
        """Inspect the graph node at the given index."""

        if index >= len(self.graph.nodes):
            raise RPCErrorCode(6)  #FIXME: use actual error code here for UNKNOWN_ERROR status

        return create_binary_descriptor(str(self.graph.nodes[index]))
Exemplo n.º 2
0
    def __init__(self, descriptor, address):
        payload = create_binary_descriptor(descriptor)
        super(AddNodeRecord, self).__init__(address,
                                            AddNodeRecord.RPC_ID,
                                            payload,
                                            response_size=4)

        self.descriptor = descriptor