def test_sighash(self):
    first = True
    for vector in self.data:
        if first:
            first = False
            continue
        tx = transaction.deserialize(convert.hex_to_bytes(vector[0]))
        script = convert.hex_to_bytes(vector[1])
        index = int(vector[2])
        hashtype = (int(vector[3]) & 4294967295)
        sighash = convert.hex_to_bytes(vector[4])[::(- 1)]
        my_sighash = transaction.sighash(tx, index, script, hashtype)
        self.assertEqual(sighash, my_sighash, 'hashtype = {:x}'.format(hashtype))
def test_sighash(self):
    first = True
    for vector in self.data:
        if first:
            first = False
            continue
        tx = transaction.deserialize(convert.hex_to_bytes(vector[0]))
        script = convert.hex_to_bytes(vector[1])
        index = int(vector[2])
        hashtype = (int(vector[3]) & 4294967295)
        sighash = convert.hex_to_bytes(vector[4])[::(- 1)]
        my_sighash = transaction.sighash(tx, index, script, hashtype)
        self.assertEqual(sighash, my_sighash, 'hashtype = {:x}'.format(hashtype))