mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-10 23:40:58 +00:00
core: keep BIP143 hashes as bytes (#258)
AFAIU, there is no need to convert them to bytearray.
This commit is contained in:
parent
bc3a4a69be
commit
99e21f2a96
@ -61,8 +61,8 @@ class Bip143:
|
||||
ensure(not tx.overwintered)
|
||||
|
||||
write_uint32(h_preimage, tx.version) # nVersion
|
||||
write_bytes(h_preimage, bytearray(self.get_prevouts_hash(coin))) # hashPrevouts
|
||||
write_bytes(h_preimage, bytearray(self.get_sequence_hash(coin))) # hashSequence
|
||||
write_bytes(h_preimage, self.get_prevouts_hash(coin)) # hashPrevouts
|
||||
write_bytes(h_preimage, self.get_sequence_hash(coin)) # hashSequence
|
||||
|
||||
write_bytes_reversed(h_preimage, txi.prev_hash) # outpoint
|
||||
write_uint32(h_preimage, txi.prev_index) # outpoint
|
||||
@ -73,7 +73,7 @@ class Bip143:
|
||||
|
||||
write_uint64(h_preimage, txi.amount) # amount
|
||||
write_uint32(h_preimage, txi.sequence) # nSequence
|
||||
write_bytes(h_preimage, bytearray(self.get_outputs_hash(coin))) # hashOutputs
|
||||
write_bytes(h_preimage, self.get_outputs_hash(coin)) # hashOutputs
|
||||
write_uint32(h_preimage, tx.lock_time) # nLockTime
|
||||
write_uint32(h_preimage, sighash) # nHashType
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user