mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
src/apps/wallet/sign_tx: small fixes to decred
This commit is contained in:
parent
6bced8bb54
commit
335504ce5c
@ -144,6 +144,7 @@ async def check_tx_fee(tx: SignTx, root: bip32.HDNode):
|
|||||||
raise SigningError(FailureType.ActionCancelled, "Output cancelled")
|
raise SigningError(FailureType.ActionCancelled, "Output cancelled")
|
||||||
|
|
||||||
if coin.decred:
|
if coin.decred:
|
||||||
|
txo.decred_script_version = txo.decred_script_version or 0
|
||||||
if txo.decred_script_version != 0:
|
if txo.decred_script_version != 0:
|
||||||
raise SigningError(
|
raise SigningError(
|
||||||
FailureType.ActionCancelled,
|
FailureType.ActionCancelled,
|
||||||
@ -398,7 +399,7 @@ async def sign_tx(tx: SignTx, root: bip32.HDNode):
|
|||||||
# STAGE_REQUEST_5_OUTPUT
|
# STAGE_REQUEST_5_OUTPUT
|
||||||
txo = await request_tx_output(tx_req, o)
|
txo = await request_tx_output(tx_req, o)
|
||||||
txo_bin.amount = txo.amount
|
txo_bin.amount = txo.amount
|
||||||
txo_bin.decred_script_version = txo.decred_script_version
|
txo_bin.decred_script_version = txo.decred_script_version or 0
|
||||||
txo_bin.script_pubkey = output_derive_script(txo, coin, root)
|
txo_bin.script_pubkey = output_derive_script(txo, coin, root)
|
||||||
|
|
||||||
# serialize output
|
# serialize output
|
||||||
@ -585,6 +586,7 @@ async def get_prevtx_output_value(
|
|||||||
for o in range(tx.outputs_cnt):
|
for o in range(tx.outputs_cnt):
|
||||||
# STAGE_REQUEST_2_PREV_OUTPUT
|
# STAGE_REQUEST_2_PREV_OUTPUT
|
||||||
txo_bin = await request_tx_output(tx_req, o, prev_hash)
|
txo_bin = await request_tx_output(tx_req, o, prev_hash)
|
||||||
|
txo_bin.decred_script_version = txo_bin.decred_script_version or 0
|
||||||
write_tx_output(txh, txo_bin)
|
write_tx_output(txh, txo_bin)
|
||||||
if o == prev_index:
|
if o == prev_index:
|
||||||
total_out += txo_bin.amount
|
total_out += txo_bin.amount
|
||||||
|
@ -37,8 +37,8 @@ def write_tx_input_check(w, i: TxInputType):
|
|||||||
|
|
||||||
def write_tx_input_decred(w, i: TxInputType):
|
def write_tx_input_decred(w, i: TxInputType):
|
||||||
write_bytes_reversed(w, i.prev_hash)
|
write_bytes_reversed(w, i.prev_hash)
|
||||||
write_uint32(w, i.prev_index)
|
write_uint32(w, i.prev_index or 0)
|
||||||
write_uint8(w, i.decred_tree)
|
write_uint8(w, i.decred_tree or 0)
|
||||||
write_uint32(w, i.sequence)
|
write_uint32(w, i.sequence)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user