1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-15 18:00:59 +00:00

nem/layout: trim and levy fee

This commit is contained in:
Tomas Susanka 2018-04-13 12:12:24 +02:00 committed by Jan Pochyla
parent 85c904cbf7
commit 9a52039b25
2 changed files with 13 additions and 1 deletions

View File

@ -34,3 +34,9 @@ async def require_confirm_final(ctx, fee: int):
def split_address(data):
return chunks(data, 17)
def trim(payload: str, length: int) -> str:
if len(payload) > length:
return payload[:length] + '..'
return payload

View File

@ -63,7 +63,7 @@ def _get_mosaic_properties(definition: NEMMosaicDefinition):
if definition.description:
t = Text('Confirm properties', ui.ICON_SEND,
ui.BOLD, 'Description:',
ui.NORMAL, definition.description)
ui.NORMAL, *split_words(trim(definition.description, 70), 22))
properties.append(t)
if definition.transferable:
transferable = 'Yes'
@ -92,6 +92,12 @@ def _get_mosaic_properties(definition: NEMMosaicDefinition):
ui.BOLD, 'Levy recipient:',
ui.MONO, *split_address(definition.levy_address))
properties.append(t)
t = Text('Confirm properties', ui.ICON_SEND,
ui.BOLD, 'Levy fee:',
ui.NORMAL, str(definition.fee),
ui.BOLD, 'Levy divisibility:',
ui.NORMAL, str(definition.divisibility))
properties.append(t)
t = Text('Confirm properties', ui.ICON_SEND,
ui.BOLD, 'Levy namespace:',
ui.NORMAL, definition.levy_namespace,