mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 00:48:19 +00:00
feat(core): allow benchmark only in debug
[no changelog]
This commit is contained in:
parent
e8f8d0e7af
commit
2d5d7201d5
@ -19,6 +19,10 @@ NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
BENCHMARK = ARGUMENTS.get('BENCHMARK', '0') == '1'
|
||||
|
||||
if BENCHMARK and PYOPT != '0':
|
||||
print("BENCHMARK=1 works only with PYOPT=0.")
|
||||
exit(1)
|
||||
|
||||
FEATURE_FLAGS = {
|
||||
"RDI": True,
|
||||
"SECP256K1_ZKP": True, # required for trezor.crypto.curve.bip340 (BIP340/Taproot)
|
||||
|
@ -17,6 +17,10 @@ FROZEN = ARGUMENTS.get('TREZOR_EMULATOR_FROZEN', 0)
|
||||
RASPI = os.getenv('TREZOR_EMULATOR_RASPI') == '1'
|
||||
|
||||
|
||||
if BENCHMARK and PYOPT != '0':
|
||||
print("BENCHMARK=1 works only with PYOPT=0.")
|
||||
exit(1)
|
||||
|
||||
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga", "sbu"]
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
@ -0,0 +1,4 @@
|
||||
if not __debug__:
|
||||
from trezor import utils
|
||||
|
||||
utils.halt("Disabled in production mode")
|
@ -207,9 +207,9 @@ def _find_message_handler_module(msg_type: int) -> str:
|
||||
return "apps.solana.sign_tx"
|
||||
|
||||
# benchmark
|
||||
if msg_type == MessageType.BenchmarkListNames:
|
||||
if __debug__ and msg_type == MessageType.BenchmarkListNames:
|
||||
return "apps.benchmark.list_names"
|
||||
if msg_type == MessageType.BenchmarkRun:
|
||||
if __debug__ and msg_type == MessageType.BenchmarkRun:
|
||||
return "apps.benchmark.run"
|
||||
|
||||
raise ValueError
|
||||
|
Loading…
Reference in New Issue
Block a user