def close(self):
        msg = message.ChannelCloseMessage(number=self.number)
        self.node.driver.write(msg.encode())
        if self.node.evm.waitForAck(msg) != RESPONSE_NO_ERROR:
            raise ChannelError('Could not close channel.')

        while True:
            msg = self.node.evm.waitForMessage(message.ChannelEventMessage)
            if msg.getMessageCode() == EVENT_CHANNEL_CLOSED:
                break
dataset/ETHPy150Open mvillalba/python-ant/src/ant/core/node.py/Channel.close/original