1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-12 01:28:10 +00:00
trezor-firmware/core/src/apps/monero/signing/step_05_all_inputs_set.py
Martin Milata 16094df0c5 refactor(core): convert most of apps.monero to layouts
Progress popups are not ported yet as they're unlike anything else.

Introduces paginate_paragraphs.
2021-06-23 11:51:18 +02:00

32 lines
926 B
Python

"""
All inputs set. Defining range signature parameters.
If in the applicable offloading mode, generate commitment masks.
"""
from apps.monero import layout
from apps.monero.xmr import crypto
from .state import State
if False:
from trezor.messages import MoneroTransactionAllInputsSetAck
async def all_inputs_set(state: State) -> MoneroTransactionAllInputsSetAck:
state.mem_trace(0)
await layout.transaction_step(state, state.STEP_ALL_IN)
from trezor.messages import MoneroTransactionAllInputsSetAck
if state.last_step != state.STEP_VINI:
raise ValueError("Invalid state transition")
if state.current_input_index != state.input_count - 1:
raise ValueError("Invalid input count")
# The sum of the masks must match the input masks sum.
state.sumout = crypto.sc_init(0)
state.last_step = state.STEP_ALL_IN
resp = MoneroTransactionAllInputsSetAck()
return resp