1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

src/apps/wallet: more work on zcash overwinter

This commit is contained in:
Pavol Rusnak 2018-06-05 17:18:37 +02:00
parent 7f36185ab3
commit cfa73b276e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 8 additions and 2 deletions

View File

@ -64,6 +64,7 @@ class Bip143:
write_uint32(h_preimage, tx.lock_time) # nLockTime
if tx.overwintered:
write_uint32(h_preimage, tx.expiry) # expiryHeight
write_varint(h_preimage, 0) # nJoinSplit
write_uint32(h_preimage, sighash) # nHashType
return get_tx_hash(h_preimage, True)

View File

@ -287,7 +287,8 @@ async def sign_tx(tx: SignTx, root: bip32.HDNode):
write_uint32(h_sign, tx.lock_time)
if tx.overwintered:
write_uint32(h_sign, tx.expiry)
write_uint32(h_sign, tx.expiry) # expiryHeight
write_varint(h_sign, 0) # nJoinSplit
write_uint32(h_sign, get_hash_type(coin))
@ -378,7 +379,8 @@ async def sign_tx(tx: SignTx, root: bip32.HDNode):
write_uint32(tx_ser.serialized_tx, tx.lock_time)
if tx.overwintered:
write_uint32(tx_ser.serialized_tx, tx.expiry)
write_uint32(tx_ser.serialized_tx, tx.expiry) # expiryHeight
write_varint(tx_ser.serialized_tx, 0) # nJoinSplit
await request_tx_finish(tx_req)
@ -415,6 +417,9 @@ async def get_prevtx_output_value(coin: CoinInfo, tx_req: TxRequest, prev_hash:
write_uint32(txh, tx.lock_time)
if tx.overwintered:
write_uint32(txh, tx.expiry)
ofs = 0
while ofs < tx.extra_data_len:
size = min(1024, tx.extra_data_len - ofs)