1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-08 23:58:09 +00:00
trezor-firmware/core/src/apps/management/wipe_device.py
grdddj 996fec5aae chore(core): delete newlines in strings where they do not delimit useful info
Done so we can use the same strings for both TT and TR

[no changelog]
2023-02-07 12:26:33 +01:00

33 lines
857 B
Python

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from trezor.wire import GenericContext
from trezor.messages import WipeDevice, Success
async def wipe_device(ctx: GenericContext, msg: WipeDevice) -> Success:
import storage
from trezor.enums import ButtonRequestType
from trezor.messages import Success
from trezor.ui.layouts import confirm_action
from apps.base import reload_settings_from_storage
await confirm_action(
ctx,
"confirm_wipe",
"Wipe device",
"All data will be erased.",
"Do you really want to wipe the device?\n",
reverse=True,
verb="Hold to confirm",
hold=True,
hold_danger=True,
br_code=ButtonRequestType.WipeDevice,
)
storage.wipe()
reload_settings_from_storage()
return Success(message="Device wiped")