You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/apps/bitcoin/sign_tx/progress.py

32 lines
602 B

from trezor import ui, utils, workflow
_progress = 0
_steps = 0
def init(inputs: int, outputs: int) -> None:
global _progress, _steps
_progress = 0
_steps = inputs + inputs + outputs + inputs
report_init()
report()
def advance(i: int = 1) -> None:
global _progress
_progress += i
report()
def report_init() -> None:
workflow.close_others()
ui.display.clear()
ui.header("Signing transaction")
def report() -> None:
if utils.DISABLE_ANIMATION:
return
p = 1000 * _progress // _steps
ui.display.loader(p, False, 18, ui.WHITE, ui.BG)