1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 12:28:09 +00:00

nem/layout: confirm payload (todo)

This commit is contained in:
Tomas Susanka 2018-03-21 15:39:32 +01:00 committed by Jan Pochyla
parent 9674a58db0
commit 302ec82d3d
2 changed files with 9 additions and 4 deletions

View File

@ -24,6 +24,12 @@ async def require_confirm_fee(ctx, value, fee):
await require_confirm(ctx, content, ButtonRequestType.ConfirmOutput)
async def require_confirm_action(ctx):
content = Text('Send unencrypted transaction?', ui.ICON_SEND)
async def require_confirm_action(ctx, payload, encrypt=False):
if encrypt:
content = Text("Send payload encrypted?", ui.ICON_SEND,
ui.NORMAL, payload)
else:
content = Text("Send payload unencrypted?", ui.ICON_SEND,
ui.NORMAL, payload,
icon_color=ui.RED)
await require_confirm(ctx, content, ButtonRequestType.ConfirmOutput)

View File

@ -40,8 +40,7 @@ async def nem_sign_tx(ctx, msg: NEMSignTx):
nem_transaction_write_mosaic(tx, mosaic.namespace, mosaic.mosaic, mosaic.quantity)
if payload: # confirm unencrypted
# todo encrypted vs unencrypted
await require_confirm_action(ctx) # todo
await require_confirm_action(ctx, msg.transfer.payload, encrypted)
await require_confirm_fee(ctx, msg.transfer.amount, msg.transaction.fee) # todo
await require_confirm_tx(ctx, msg.transfer.recipient, msg.transfer.amount) # todo