1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-28 09:08:07 +00:00
trezor-firmware/src/apps/common/storage.py

19 lines
364 B
Python
Raw Normal View History

2016-09-29 10:29:43 +00:00
from micropython import const
2016-09-26 11:06:28 +00:00
from trezor import config
APP_MANAGEMENT = const(1)
CFG_STORAGE = const(1)
def get_storage(session_id):
return config.get(session_id, APP_MANAGEMENT, CFG_STORAGE)
def set_storage(session_id, buf):
config.set(session_id, APP_MANAGEMENT, CFG_STORAGE, buf)
def clear_storage(session_id):
2016-09-29 10:29:43 +00:00
set_storage(session_id, b'')