Skip to content

Commit

Permalink
chore(core/nostr): remove Nostr from production build
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
ibz committed Dec 19, 2024
1 parent 57d5e0d commit 4076b62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
7 changes: 4 additions & 3 deletions core/SConscript.firmware
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,10 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py'))
if PYOPT == '0':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/ripple/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Ripple*.py'))
Expand Down
7 changes: 4 additions & 3 deletions core/SConscript.unix
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,10 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py'))
if PYOPT == '0':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/ripple/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Ripple*.py'))
Expand Down
14 changes: 9 additions & 5 deletions core/src/apps/workflow_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ def _find_message_handler_module(msg_type: int) -> str:
if msg_type == MessageType.GetFirmwareHash:
return "apps.misc.get_firmware_hash"

# nostr
if msg_type == MessageType.NostrGetPubkey:
return "apps.nostr.get_pubkey"
if msg_type == MessageType.NostrSignEvent:
return "apps.nostr.sign_event"
# When promoting the Nostr app to production-level
# and removing the "if" guard don't forget to also remove
# the corresponding guards (PYOPT == '0') in Sconscript.*
if __debug__:
# nostr
if msg_type == MessageType.NostrGetPubkey:
return "apps.nostr.get_pubkey"
if msg_type == MessageType.NostrSignEvent:
return "apps.nostr.sign_event"

if not utils.BITCOIN_ONLY:
if msg_type == MessageType.SetU2FCounter:
Expand Down

0 comments on commit 4076b62

Please sign in to comment.