|
|
|
@ -5,13 +5,14 @@ from apps.monero import layout, misc
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from trezor.messages import (
|
|
|
|
|
MoneroLiveRefreshStepAck,
|
|
|
|
|
MoneroLiveRefreshStepRequest,
|
|
|
|
|
MoneroLiveRefreshStartRequest,
|
|
|
|
|
MoneroLiveRefreshFinalAck,
|
|
|
|
|
MoneroLiveRefreshStartAck,
|
|
|
|
|
MoneroLiveRefreshStartRequest,
|
|
|
|
|
MoneroLiveRefreshStepAck,
|
|
|
|
|
MoneroLiveRefreshStepRequest,
|
|
|
|
|
)
|
|
|
|
|
from trezor.ui.layouts.common import ProgressLayout
|
|
|
|
|
|
|
|
|
|
from apps.common.keychain import Keychain
|
|
|
|
|
|
|
|
|
|
from .xmr.credentials import AccountCreds
|
|
|
|
@ -22,6 +23,7 @@ async def live_refresh(
|
|
|
|
|
msg: MoneroLiveRefreshStartRequest, keychain: Keychain
|
|
|
|
|
) -> MoneroLiveRefreshFinalAck:
|
|
|
|
|
import gc
|
|
|
|
|
|
|
|
|
|
from trezor.enums import MessageType
|
|
|
|
|
from trezor.messages import MoneroLiveRefreshFinalAck, MoneroLiveRefreshStepRequest
|
|
|
|
|
from trezor.wire.context import call_any
|
|
|
|
@ -56,9 +58,10 @@ async def _init_step(
|
|
|
|
|
keychain: Keychain,
|
|
|
|
|
) -> MoneroLiveRefreshStartAck:
|
|
|
|
|
import storage.cache as storage_cache
|
|
|
|
|
from apps.common import paths
|
|
|
|
|
from trezor.messages import MoneroLiveRefreshStartAck
|
|
|
|
|
|
|
|
|
|
from apps.common import paths
|
|
|
|
|
|
|
|
|
|
await paths.validate_path(keychain, msg.address_n)
|
|
|
|
|
|
|
|
|
|
if not storage_cache.get(storage_cache.APP_MONERO_LIVE_REFRESH):
|
|
|
|
@ -75,8 +78,9 @@ def _refresh_step(
|
|
|
|
|
msg: MoneroLiveRefreshStepRequest,
|
|
|
|
|
progress: ProgressLayout,
|
|
|
|
|
) -> MoneroLiveRefreshStepAck:
|
|
|
|
|
from trezor.messages import MoneroLiveRefreshStepAck
|
|
|
|
|
from trezor import log
|
|
|
|
|
from trezor.messages import MoneroLiveRefreshStepAck
|
|
|
|
|
|
|
|
|
|
from apps.monero.xmr import chacha_poly, crypto, crypto_helpers, key_image, monero
|
|
|
|
|
|
|
|
|
|
assert s.creds is not None
|
|
|
|
|