mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
nem: fix mosaic properties list
This commit is contained in:
parent
67c07902a3
commit
8cebcaba01
@ -1,6 +1,6 @@
|
|||||||
from micropython import const
|
from micropython import const
|
||||||
|
|
||||||
from trezor import ui
|
from trezor import ui, wire
|
||||||
from trezor.messages import (
|
from trezor.messages import (
|
||||||
NEMMosaicCreation,
|
NEMMosaicCreation,
|
||||||
NEMMosaicDefinition,
|
NEMMosaicDefinition,
|
||||||
@ -9,7 +9,7 @@ from trezor.messages import (
|
|||||||
NEMSupplyChangeType,
|
NEMSupplyChangeType,
|
||||||
NEMTransactionCommon,
|
NEMTransactionCommon,
|
||||||
)
|
)
|
||||||
from trezor.ui.confirm import ConfirmDialog
|
from trezor.ui.confirm import ConfirmDialog, CONFIRMED
|
||||||
from trezor.ui.scroll import Scrollpage, animate_swipe, paginate
|
from trezor.ui.scroll import Scrollpage, animate_swipe, paginate
|
||||||
from trezor.ui.text import Text
|
from trezor.ui.text import Text
|
||||||
|
|
||||||
@ -75,6 +75,7 @@ def _supply_message(supply_change):
|
|||||||
|
|
||||||
|
|
||||||
async def _require_confirm_properties(ctx, definition: NEMMosaicDefinition):
|
async def _require_confirm_properties(ctx, definition: NEMMosaicDefinition):
|
||||||
|
# TODO: we should send a button request here
|
||||||
properties = _get_mosaic_properties(definition)
|
properties = _get_mosaic_properties(definition)
|
||||||
first_page = const(0)
|
first_page = const(0)
|
||||||
paginator = paginate(_show_page, len(properties), first_page, properties)
|
paginator = paginate(_show_page, len(properties), first_page, properties)
|
||||||
@ -85,7 +86,8 @@ async def _require_confirm_properties(ctx, definition: NEMMosaicDefinition):
|
|||||||
async def _show_page(page: int, page_count: int, content):
|
async def _show_page(page: int, page_count: int, content):
|
||||||
content = Scrollpage(content[page], page, page_count)
|
content = Scrollpage(content[page], page, page_count)
|
||||||
if page + 1 == page_count:
|
if page + 1 == page_count:
|
||||||
await ConfirmDialog(content)
|
if await ConfirmDialog(content) != CONFIRMED:
|
||||||
|
raise wire.ActionCancelled("Action cancelled")
|
||||||
else:
|
else:
|
||||||
content.render()
|
content.render()
|
||||||
await animate_swipe()
|
await animate_swipe()
|
||||||
|
1
vendor/trezor-storage
vendored
Submodule
1
vendor/trezor-storage
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 8970e2bdebb3334ddd0bacf41c66be79e78880f8
|
Loading…
Reference in New Issue
Block a user