1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-02 04:42:33 +00:00
trezor-firmware/core/src/apps/management/wipe_device.py
2021-03-30 22:34:01 +02:00

30 lines
767 B
Python

import storage
from trezor import ui
from trezor.messages import ButtonRequestType
from trezor.messages.Success import Success
from trezor.ui.layouts import confirm_action
from .apply_settings import reload_settings_from_storage
async def wipe_device(ctx, msg):
await confirm_action(
ctx,
"confirm_wipe",
title="Wipe device",
description="Do you really want to\nwipe the device?\n",
action="All data will be lost.",
reverse=True,
verb="Hold to confirm",
hold=True,
hold_danger=True,
icon=ui.ICON_WIPE,
icon_color=ui.RED,
br_code=ButtonRequestType.WipeDevice,
)
storage.wipe()
reload_settings_from_storage()
return Success(message="Device wiped")