<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetScriptHashesForVerifying(self):
 """ Get the script hash used for verification. Raises: Exception: if the verification script is invalid, or no header could be retrieved from the Blockchain. Returns: list: with a single UInt160 representing the next consensus node. """

        # if this is the genesis block, we dont have a prev hash!
        if self.PrevHash.Data == bytearray(32):
            #            logger.info("verificiation script %s"  %(self.Script.ToJson()))
            if type(self.Script.VerificationScript) is bytes:
                return [bytearray(self.Script.VerificationScript)]
            elif type(self.Script.VerificationScript) is bytearray:
                return [self.Script.VerificationScript]
            else:
                raise Exception('Invalid Verification script')

        prev_header = GetBlockchain().GetHeader(self.PrevHash.ToBytes())
        if prev_header is None:
            raise Exception('Invalid operation')
        return [prev_header.NextConsensus]