1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

core/tezos: add ButtonRequest in front of proposal paginator

This commit is contained in:
matejcik 2019-04-18 15:43:33 +02:00
parent 1e7357db80
commit 1e1e6513a0
2 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,9 @@
from micropython import const
from trezor import ui, wire
from trezor.messages import ButtonRequestType
from trezor.ui.confirm import CANCELLED, CONFIRMED, ConfirmDialog
from trezor.messages import ButtonRequestType, MessageType
from trezor.messages.ButtonRequest import ButtonRequest
from trezor.ui.confirm import CANCELLED, ConfirmDialog
from trezor.ui.scroll import Scrollpage, animate_swipe, paginate
from trezor.ui.text import Text
from trezor.utils import chunks, format_amount
@ -88,7 +89,8 @@ async def require_confirm_ballot(ctx, proposal, ballot):
# use, when there are more then one proposals in one operation
async def show_proposals(ctx, proposals):
async def require_confirm_proposals(ctx, proposals):
await ctx.call(ButtonRequest(code=ButtonRequestType.SignTx), MessageType.ButtonAck)
first_page = const(0)
pages = proposals
title = "Submit proposals" if len(proposals) > 1 else "Submit proposal"

View File

@ -63,7 +63,7 @@ async def sign_tx(ctx, msg, keychain):
elif msg.proposal is not None:
proposed_protocols = [_get_protocol_hash(p) for p in msg.proposal.proposals]
await layout.show_proposals(ctx, proposed_protocols)
await layout.require_confirm_proposals(ctx, proposed_protocols)
elif msg.ballot is not None:
proposed_protocol = _get_protocol_hash(msg.ballot.proposal)