diff --git a/core/embed/upymod/qstrdefsport.h b/core/embed/upymod/qstrdefsport.h index 4fe0a54ce6..c1d22c61cb 100644 --- a/core/embed/upymod/qstrdefsport.h +++ b/core/embed/upymod/qstrdefsport.h @@ -1,6 +1,821 @@ -// Some additional strings that can’t be expressed using the `MP_QSTR_Foo` -// syntax: -// https://docs.micropython.org/en/latest/develop/qstr.html#compile-time-qstr-generation +// generated from qstrdefsport.h.mako +// (by running `make templates` in `core`) +// do not edit manually! +// fmt: off + +#error This header should not be part of the build, its purpose is only to add missed Qstrings + +// explanation: +// uPy collects string literals and symbol names from all frozen modules, and +// converts them to qstrings for certain usages. In particular, it appears that +// qualified names of modules in sys.modules must be qstrings. However, the +// collection process is imperfect. If `apps.common.mnemonic` is always imported +// as `from ..common import mnemonic`, the string "apps.common.mnemonic" never +// appears in source code, is never collected, but then is generated and +// interned at runtime. A similar thing happens in reverse: if module +// `storage.cache` is always imported as this name, then "storage.cache" is +// collected but neither "storage" nor "cache" alone. Which is a problem, +// because "cache" is a symbol that is added to `storage`'s dict. +// +// We need to avoid run-time interning as much as possible, because it creates +// uncollectable garbage in the GC arena. + +Q(boot) +Q(main) +Q(session) +Q(typing) +Q(usb) +Q(storage) +Q(storage.cache) +Q(cache) +Q(storage.cache_codec) +Q(cache_codec) +Q(storage.cache_common) +Q(cache_common) +Q(storage.common) +Q(common) +Q(storage.debug) +Q(debug) +Q(storage.device) +Q(device) +Q(storage.fido2) +Q(fido2) +Q(storage.recovery) +Q(recovery) +Q(storage.recovery_shares) +Q(recovery_shares) +Q(storage.resident_credentials) +Q(resident_credentials) +Q(storage.sd_salt) +Q(sd_salt) +Q(trezor) +Q(trezor.crypto) +Q(crypto) +Q(trezor.crypto.base32) +Q(base32) +Q(trezor.crypto.base58) +Q(base58) +Q(trezor.crypto.bech32) +Q(bech32) +Q(trezor.crypto.cashaddr) +Q(cashaddr) +Q(trezor.crypto.cosi) +Q(cosi) +Q(trezor.crypto.curve) +Q(curve) +Q(trezor.crypto.der) +Q(der) +Q(trezor.crypto.hashlib) +Q(hashlib) +Q(trezor.crypto.rlp) +Q(rlp) +Q(trezor.crypto.scripts) +Q(scripts) +Q(trezor.crypto.slip39) +Q(slip39) +Q(trezor.enums.AmountUnit) +Q(AmountUnit) +Q(trezor.enums.BackupAvailability) +Q(BackupAvailability) +Q(trezor.enums.BackupType) +Q(BackupType) +Q(trezor.enums.BootCommand) +Q(BootCommand) +Q(trezor.enums.ButtonRequestType) +Q(ButtonRequestType) +Q(trezor.enums.Capability) +Q(Capability) +Q(trezor.enums.DebugButton) +Q(DebugButton) +Q(trezor.enums.DebugPhysicalButton) +Q(DebugPhysicalButton) +Q(trezor.enums.DebugSwipeDirection) +Q(DebugSwipeDirection) +Q(trezor.enums.DebugWaitType) +Q(DebugWaitType) +Q(trezor.enums.DecredStakingSpendType) +Q(DecredStakingSpendType) +Q(trezor.enums.DisplayRotation) +Q(DisplayRotation) +Q(trezor.enums.FailureType) +Q(FailureType) +Q(trezor.enums.HomescreenFormat) +Q(HomescreenFormat) +Q(trezor.enums.InputScriptType) +Q(InputScriptType) +Q(trezor.enums.MessageType) +Q(MessageType) +Q(trezor.enums.MultisigPubkeysOrder) +Q(MultisigPubkeysOrder) +Q(trezor.enums.OutputScriptType) +Q(OutputScriptType) +Q(trezor.enums.PinMatrixRequestType) +Q(PinMatrixRequestType) +Q(trezor.enums.RecoveryDeviceInputMethod) +Q(RecoveryDeviceInputMethod) +Q(trezor.enums.RecoveryStatus) +Q(RecoveryStatus) +Q(trezor.enums.RecoveryType) +Q(RecoveryType) +Q(trezor.enums.RequestType) +Q(RequestType) +Q(trezor.enums.SafetyCheckLevel) +Q(SafetyCheckLevel) +Q(trezor.enums.SdProtectOperationType) +Q(SdProtectOperationType) +Q(trezor.enums.WordRequestType) +Q(WordRequestType) +Q(trezor.enums) +Q(enums) +Q(trezor.errors) +Q(errors) +Q(trezor.log) +Q(log) +Q(trezor.loop) +Q(loop) +Q(trezor.messages) +Q(messages) +Q(trezor.pin) +Q(pin) +Q(trezor.protobuf) +Q(protobuf) +Q(trezor.sdcard) +Q(sdcard) +Q(trezor.strings) +Q(strings) +Q(trezor.ui) +Q(ui) +Q(trezor.ui.layouts) +Q(layouts) +Q(trezor.ui.layouts.bolt) +Q(bolt) +Q(trezor.ui.layouts.bolt.fido) +Q(fido) +Q(trezor.ui.layouts.bolt.recovery) +Q(trezor.ui.layouts.bolt.reset) +Q(reset) +Q(trezor.ui.layouts.caesar) +Q(caesar) +Q(trezor.ui.layouts.caesar.fido) +Q(trezor.ui.layouts.caesar.recovery) +Q(trezor.ui.layouts.caesar.reset) +Q(trezor.ui.layouts.common) +Q(trezor.ui.layouts.delizia) +Q(delizia) +Q(trezor.ui.layouts.delizia.fido) +Q(trezor.ui.layouts.delizia.recovery) +Q(trezor.ui.layouts.delizia.reset) +Q(trezor.ui.layouts.fido) +Q(trezor.ui.layouts.homescreen) +Q(homescreen) +Q(trezor.ui.layouts.progress) +Q(progress) +Q(trezor.ui.layouts.recovery) +Q(trezor.ui.layouts.reset) +Q(trezor.utils) +Q(utils) +Q(trezor.wire) +Q(wire) +Q(trezor.wire.codec) +Q(codec) +Q(trezor.wire.codec.codec_context) +Q(codec_context) +Q(trezor.wire.codec.codec_v1) +Q(codec_v1) +Q(trezor.wire.context) +Q(context) +Q(trezor.wire.errors) +Q(trezor.wire.message_handler) +Q(message_handler) +Q(trezor.wire.protocol_common) +Q(protocol_common) +Q(trezor.workflow) +Q(workflow) +Q(apps) +Q(apps.base) +Q(base) +Q(apps.benchmark) +Q(benchmark) +Q(apps.benchmark.benchmark) +Q(apps.benchmark.benchmarks) +Q(benchmarks) +Q(apps.benchmark.cipher_benchmark) +Q(cipher_benchmark) +Q(apps.benchmark.common) +Q(apps.benchmark.curve_benchmark) +Q(curve_benchmark) +Q(apps.benchmark.hash_benchmark) +Q(hash_benchmark) +Q(apps.benchmark.list_names) +Q(list_names) +Q(apps.benchmark.run) +Q(run) +Q(apps.bitcoin) +Q(bitcoin) +Q(apps.bitcoin.addresses) +Q(addresses) +Q(apps.bitcoin.authorization) +Q(authorization) +Q(apps.bitcoin.authorize_coinjoin) +Q(authorize_coinjoin) +Q(apps.bitcoin.common) +Q(apps.bitcoin.get_address) +Q(get_address) +Q(apps.bitcoin.get_ownership_id) +Q(get_ownership_id) +Q(apps.bitcoin.get_ownership_proof) +Q(get_ownership_proof) +Q(apps.bitcoin.get_public_key) +Q(get_public_key) +Q(apps.bitcoin.keychain) +Q(keychain) +Q(apps.bitcoin.multisig) +Q(multisig) +Q(apps.bitcoin.ownership) +Q(ownership) +Q(apps.bitcoin.readers) +Q(readers) +Q(apps.bitcoin.scripts) +Q(apps.bitcoin.scripts_decred) +Q(scripts_decred) +Q(apps.bitcoin.sign_message) +Q(sign_message) +Q(apps.bitcoin.sign_tx) +Q(sign_tx) +Q(apps.bitcoin.sign_tx.approvers) +Q(approvers) +Q(apps.bitcoin.sign_tx.bitcoin) +Q(apps.bitcoin.sign_tx.bitcoinlike) +Q(bitcoinlike) +Q(apps.bitcoin.sign_tx.change_detector) +Q(change_detector) +Q(apps.bitcoin.sign_tx.decred) +Q(decred) +Q(apps.bitcoin.sign_tx.helpers) +Q(helpers) +Q(apps.bitcoin.sign_tx.layout) +Q(layout) +Q(apps.bitcoin.sign_tx.matchcheck) +Q(matchcheck) +Q(apps.bitcoin.sign_tx.omni) +Q(omni) +Q(apps.bitcoin.sign_tx.payment_request) +Q(payment_request) +Q(apps.bitcoin.sign_tx.progress) +Q(apps.bitcoin.sign_tx.sig_hasher) +Q(sig_hasher) +Q(apps.bitcoin.sign_tx.tx_info) +Q(tx_info) +Q(apps.bitcoin.sign_tx.tx_weight) +Q(tx_weight) +Q(apps.bitcoin.verification) +Q(verification) +Q(apps.bitcoin.verify_message) +Q(verify_message) +Q(apps.bitcoin.writers) +Q(writers) +Q(apps.common) +Q(apps.common.address_mac) +Q(address_mac) +Q(apps.common.address_type) +Q(address_type) +Q(apps.common.authorization) +Q(apps.common.backup) +Q(backup) +Q(apps.common.backup_types) +Q(backup_types) +Q(apps.common.cache) +Q(apps.common.cbor) +Q(cbor) +Q(apps.common.coininfo) +Q(coininfo) +Q(apps.common.coins) +Q(coins) +Q(apps.common.keychain) +Q(apps.common.passphrase) +Q(passphrase) +Q(apps.common.paths) +Q(paths) +Q(apps.common.readers) +Q(apps.common.request_pin) +Q(request_pin) +Q(apps.common.safety_checks) +Q(safety_checks) +Q(apps.common.sdcard) +Q(apps.common.seed) +Q(seed) +Q(apps.common.signverify) +Q(signverify) +Q(apps.common.writers) +Q(apps.debug) +Q(apps.debug.load_device) +Q(load_device) +Q(apps.homescreen) +Q(apps.management) +Q(management) +Q(apps.management.apply_flags) +Q(apply_flags) +Q(apps.management.apply_settings) +Q(apply_settings) +Q(apps.management.authenticate_device) +Q(authenticate_device) +Q(apps.management.backup_device) +Q(backup_device) +Q(apps.management.ble.unpair) +Q(unpair) +Q(apps.management.change_language) +Q(change_language) +Q(apps.management.change_pin) +Q(change_pin) +Q(apps.management.change_wipe_code) +Q(change_wipe_code) +Q(apps.management.get_next_u2f_counter) +Q(get_next_u2f_counter) +Q(apps.management.get_nonce) +Q(get_nonce) +Q(apps.management.reboot_to_bootloader) +Q(reboot_to_bootloader) +Q(apps.management.recovery_device) +Q(recovery_device) +Q(apps.management.recovery_device.homescreen) +Q(apps.management.recovery_device.layout) +Q(apps.management.recovery_device.recover) +Q(recover) +Q(apps.management.recovery_device.word_validity) +Q(word_validity) +Q(apps.management.reset_device) +Q(reset_device) +Q(apps.management.reset_device.layout) +Q(apps.management.sd_protect) +Q(sd_protect) +Q(apps.management.set_brightness) +Q(set_brightness) +Q(apps.management.set_u2f_counter) +Q(set_u2f_counter) +Q(apps.management.show_tutorial) +Q(show_tutorial) +Q(apps.management.wipe_device) +Q(wipe_device) +Q(apps.misc) +Q(misc) +Q(apps.misc.cipher_key_value) +Q(cipher_key_value) +Q(apps.misc.get_ecdh_session_key) +Q(get_ecdh_session_key) +Q(apps.misc.get_entropy) +Q(get_entropy) +Q(apps.misc.get_firmware_hash) +Q(get_firmware_hash) +Q(apps.misc.sign_identity) +Q(sign_identity) +Q(apps.nostr) +Q(nostr) +Q(apps.nostr.get_pubkey) +Q(get_pubkey) +Q(apps.nostr.sign_event) +Q(sign_event) +Q(apps.workflow_handlers) +Q(workflow_handlers) + +#if USE_THP +Q(apps.thp) +Q(thp) +Q(apps.thp.credential_manager) +Q(credential_manager) +#endif + +#if !BITCOIN_ONLY +Q(trezor.enums.BinanceOrderSide) +Q(BinanceOrderSide) +Q(trezor.enums.BinanceOrderType) +Q(BinanceOrderType) +Q(trezor.enums.BinanceTimeInForce) +Q(BinanceTimeInForce) +Q(trezor.enums.CardanoAddressType) +Q(CardanoAddressType) +Q(trezor.enums.CardanoCVoteRegistrationFormat) +Q(CardanoCVoteRegistrationFormat) +Q(trezor.enums.CardanoCertificateType) +Q(CardanoCertificateType) +Q(trezor.enums.CardanoDRepType) +Q(CardanoDRepType) +Q(trezor.enums.CardanoDerivationType) +Q(CardanoDerivationType) +Q(trezor.enums.CardanoNativeScriptHashDisplayFormat) +Q(CardanoNativeScriptHashDisplayFormat) +Q(trezor.enums.CardanoNativeScriptType) +Q(CardanoNativeScriptType) +Q(trezor.enums.CardanoPoolRelayType) +Q(CardanoPoolRelayType) +Q(trezor.enums.CardanoTxAuxiliaryDataSupplementType) +Q(CardanoTxAuxiliaryDataSupplementType) +Q(trezor.enums.CardanoTxOutputSerializationFormat) +Q(CardanoTxOutputSerializationFormat) +Q(trezor.enums.CardanoTxSigningMode) +Q(CardanoTxSigningMode) +Q(trezor.enums.CardanoTxWitnessType) +Q(CardanoTxWitnessType) +Q(trezor.enums.EthereumDataType) +Q(EthereumDataType) +Q(trezor.enums.EthereumDefinitionType) +Q(EthereumDefinitionType) +Q(trezor.enums.MoneroNetworkType) +Q(MoneroNetworkType) +Q(trezor.enums.NEMImportanceTransferMode) +Q(NEMImportanceTransferMode) +Q(trezor.enums.NEMModificationType) +Q(NEMModificationType) +Q(trezor.enums.NEMMosaicLevy) +Q(NEMMosaicLevy) +Q(trezor.enums.NEMSupplyChangeType) +Q(NEMSupplyChangeType) +Q(trezor.enums.StellarAssetType) +Q(StellarAssetType) +Q(trezor.enums.StellarMemoType) +Q(StellarMemoType) +Q(trezor.enums.StellarSignerType) +Q(StellarSignerType) +Q(trezor.enums.TezosBallotType) +Q(TezosBallotType) +Q(trezor.enums.TezosContractType) +Q(TezosContractType) +Q(apps.binance) +Q(binance) +Q(apps.binance.get_address) +Q(get_address) +Q(apps.binance.get_public_key) +Q(get_public_key) +Q(apps.binance.helpers) +Q(helpers) +Q(apps.binance.layout) +Q(layout) +Q(apps.binance.sign_tx) +Q(sign_tx) +Q(apps.bitcoin.sign_tx.zcash_v4) +Q(zcash_v4) +Q(apps.cardano) +Q(cardano) +Q(apps.cardano.addresses) +Q(addresses) +Q(apps.cardano.auxiliary_data) +Q(auxiliary_data) +Q(apps.cardano.byron_addresses) +Q(byron_addresses) +Q(apps.cardano.certificates) +Q(certificates) +Q(apps.cardano.get_address) +Q(apps.cardano.get_native_script_hash) +Q(get_native_script_hash) +Q(apps.cardano.get_public_key) +Q(apps.cardano.helpers) +Q(apps.cardano.helpers.account_path_check) +Q(account_path_check) +Q(apps.cardano.helpers.bech32) +Q(bech32) +Q(apps.cardano.helpers.credential) +Q(credential) +Q(apps.cardano.helpers.hash_builder_collection) +Q(hash_builder_collection) +Q(apps.cardano.helpers.network_ids) +Q(network_ids) +Q(apps.cardano.helpers.paths) +Q(paths) +Q(apps.cardano.helpers.protocol_magics) +Q(protocol_magics) +Q(apps.cardano.helpers.utils) +Q(utils) +Q(apps.cardano.layout) +Q(apps.cardano.native_script) +Q(native_script) +Q(apps.cardano.seed) +Q(seed) +Q(apps.cardano.sign_tx) +Q(apps.cardano.sign_tx.multisig_signer) +Q(multisig_signer) +Q(apps.cardano.sign_tx.ordinary_signer) +Q(ordinary_signer) +Q(apps.cardano.sign_tx.plutus_signer) +Q(plutus_signer) +Q(apps.cardano.sign_tx.pool_owner_signer) +Q(pool_owner_signer) +Q(apps.cardano.sign_tx.signer) +Q(signer) +Q(apps.common.mnemonic) +Q(mnemonic) +Q(apps.eos) +Q(eos) +Q(apps.eos.actions) +Q(actions) +Q(apps.eos.actions.layout) +Q(apps.eos.get_public_key) +Q(apps.eos.helpers) +Q(apps.eos.layout) +Q(apps.eos.sign_tx) +Q(apps.eos.writers) +Q(writers) +Q(apps.ethereum) +Q(ethereum) +Q(apps.ethereum.definitions) +Q(definitions) +Q(apps.ethereum.definitions_constants) +Q(definitions_constants) +Q(apps.ethereum.get_address) +Q(apps.ethereum.get_public_key) +Q(apps.ethereum.helpers) +Q(apps.ethereum.keychain) +Q(keychain) +Q(apps.ethereum.layout) +Q(apps.ethereum.networks) +Q(networks) +Q(apps.ethereum.sign_message) +Q(sign_message) +Q(apps.ethereum.sign_tx) +Q(apps.ethereum.sign_tx_eip1559) +Q(sign_tx_eip1559) +Q(apps.ethereum.sign_typed_data) +Q(sign_typed_data) +Q(apps.ethereum.staking_tx_constants) +Q(staking_tx_constants) +Q(apps.ethereum.tokens) +Q(tokens) +Q(apps.ethereum.verify_message) +Q(verify_message) +Q(apps.monero) +Q(monero) +Q(apps.monero.diag) +Q(diag) +Q(apps.monero.get_address) +Q(apps.monero.get_tx_keys) +Q(get_tx_keys) +Q(apps.monero.get_watch_only) +Q(get_watch_only) +Q(apps.monero.key_image_sync) +Q(key_image_sync) +Q(apps.monero.layout) +Q(apps.monero.live_refresh) +Q(live_refresh) +Q(apps.monero.misc) +Q(misc) +Q(apps.monero.sign_tx) +Q(apps.monero.signing) +Q(signing) +Q(apps.monero.signing.offloading_keys) +Q(offloading_keys) +Q(apps.monero.signing.state) +Q(state) +Q(apps.monero.signing.step_01_init_transaction) +Q(step_01_init_transaction) +Q(apps.monero.signing.step_02_set_input) +Q(step_02_set_input) +Q(apps.monero.signing.step_04_input_vini) +Q(step_04_input_vini) +Q(apps.monero.signing.step_05_all_inputs_set) +Q(step_05_all_inputs_set) +Q(apps.monero.signing.step_06_set_output) +Q(step_06_set_output) +Q(apps.monero.signing.step_07_all_outputs_set) +Q(step_07_all_outputs_set) +Q(apps.monero.signing.step_09_sign_input) +Q(step_09_sign_input) +Q(apps.monero.signing.step_10_sign_final) +Q(step_10_sign_final) +Q(apps.monero.xmr) +Q(xmr) +Q(apps.monero.xmr.addresses) +Q(apps.monero.xmr.bulletproof) +Q(bulletproof) +Q(apps.monero.xmr.chacha_poly) +Q(chacha_poly) +Q(apps.monero.xmr.clsag) +Q(clsag) +Q(apps.monero.xmr.credentials) +Q(credentials) +Q(apps.monero.xmr.crypto_helpers) +Q(crypto_helpers) +Q(apps.monero.xmr.keccak_hasher) +Q(keccak_hasher) +Q(apps.monero.xmr.key_image) +Q(key_image) +Q(apps.monero.xmr.mlsag_hasher) +Q(mlsag_hasher) +Q(apps.monero.xmr.monero) +Q(apps.monero.xmr.networks) +Q(apps.monero.xmr.range_signatures) +Q(range_signatures) +Q(apps.monero.xmr.serialize) +Q(serialize) +Q(apps.monero.xmr.serialize.base_types) +Q(base_types) +Q(apps.monero.xmr.serialize.int_serialize) +Q(int_serialize) +Q(apps.monero.xmr.serialize.message_types) +Q(message_types) +Q(apps.monero.xmr.serialize.readwriter) +Q(readwriter) +Q(apps.monero.xmr.serialize_messages.base) +Q(base) +Q(apps.monero.xmr.serialize_messages.tx_ct_key) +Q(tx_ct_key) +Q(apps.monero.xmr.serialize_messages.tx_ecdh) +Q(tx_ecdh) +Q(apps.monero.xmr.serialize_messages.tx_prefix) +Q(tx_prefix) +Q(apps.monero.xmr.serialize_messages.tx_rsig_bulletproof) +Q(tx_rsig_bulletproof) +Q(apps.nem) +Q(nem) +Q(apps.nem.get_address) +Q(apps.nem.helpers) +Q(apps.nem.layout) +Q(apps.nem.mosaic) +Q(mosaic) +Q(apps.nem.mosaic.helpers) +Q(apps.nem.mosaic.layout) +Q(apps.nem.mosaic.nem_mosaics) +Q(nem_mosaics) +Q(apps.nem.mosaic.serialize) +Q(apps.nem.multisig) +Q(multisig) +Q(apps.nem.multisig.layout) +Q(apps.nem.multisig.serialize) +Q(apps.nem.namespace) +Q(namespace) +Q(apps.nem.namespace.layout) +Q(apps.nem.namespace.serialize) +Q(apps.nem.sign_tx) +Q(apps.nem.transfer) +Q(transfer) +Q(apps.nem.transfer.layout) +Q(apps.nem.transfer.serialize) +Q(apps.nem.validators) +Q(validators) +Q(apps.nem.writers) +Q(apps.ripple) +Q(ripple) +Q(apps.ripple.base58_ripple) +Q(base58_ripple) +Q(apps.ripple.get_address) +Q(apps.ripple.helpers) +Q(apps.ripple.layout) +Q(apps.ripple.serialize) +Q(apps.ripple.sign_tx) +Q(apps.solana) +Q(solana) +Q(apps.solana.constants) +Q(constants) +Q(apps.solana.format) +Q(format) +Q(apps.solana.get_address) +Q(apps.solana.get_public_key) +Q(apps.solana.layout) +Q(apps.solana.predefined_transaction) +Q(predefined_transaction) +Q(apps.solana.sign_tx) +Q(apps.solana.token_account) +Q(token_account) +Q(apps.solana.transaction) +Q(transaction) +Q(apps.solana.transaction.instruction) +Q(instruction) +Q(apps.solana.transaction.instructions) +Q(instructions) +Q(apps.solana.transaction.parse) +Q(parse) +Q(apps.solana.types) +Q(types) +Q(apps.stellar) +Q(stellar) +Q(apps.stellar.consts) +Q(consts) +Q(apps.stellar.get_address) +Q(apps.stellar.helpers) +Q(apps.stellar.layout) +Q(apps.stellar.operations) +Q(operations) +Q(apps.stellar.operations.layout) +Q(apps.stellar.operations.serialize) +Q(apps.stellar.sign_tx) +Q(apps.stellar.writers) +Q(apps.tezos) +Q(tezos) +Q(apps.tezos.get_address) +Q(apps.tezos.get_public_key) +Q(apps.tezos.helpers) +Q(apps.tezos.layout) +Q(apps.tezos.sign_tx) +Q(apps.webauthn) +Q(webauthn) +Q(apps.webauthn.add_resident_credential) +Q(add_resident_credential) +Q(apps.webauthn.common) +Q(common) +Q(apps.webauthn.credential) +Q(apps.webauthn.fido2) +Q(fido2) +Q(apps.webauthn.knownapps) +Q(knownapps) +Q(apps.webauthn.list_resident_credentials) +Q(list_resident_credentials) +Q(apps.webauthn.remove_resident_credential) +Q(remove_resident_credential) +Q(apps.webauthn.resident_credentials) +Q(resident_credentials) +Q(apps.zcash) +Q(zcash) +Q(apps.zcash.f4jumble) +Q(f4jumble) +Q(apps.zcash.hasher) +Q(hasher) +Q(apps.zcash.signer) +Q(apps.zcash.unified_addresses) +Q(unified_addresses) +#endif + +// generate full alphabet +Q(a) +Q(A) +Q(b) +Q(B) +Q(c) +Q(C) +Q(d) +Q(D) +Q(e) +Q(E) +Q(f) +Q(F) +Q(g) +Q(G) +Q(h) +Q(H) +Q(i) +Q(I) +Q(j) +Q(J) +Q(k) +Q(K) +Q(l) +Q(L) +Q(m) +Q(M) +Q(n) +Q(N) +Q(o) +Q(O) +Q(p) +Q(P) +Q(q) +Q(Q) +Q(r) +Q(R) +Q(s) +Q(S) +Q(t) +Q(T) +Q(u) +Q(U) +Q(v) +Q(V) +Q(w) +Q(W) +Q(x) +Q(X) +Q(y) +Q(Y) +Q(z) +Q(Z) + +// generate module presizing identifiers +Q(___PRESIZE_MODULE_0) +Q(___PRESIZE_MODULE_1) +Q(___PRESIZE_MODULE_2) +Q(___PRESIZE_MODULE_3) +Q(___PRESIZE_MODULE_4) +Q(___PRESIZE_MODULE_5) +Q(___PRESIZE_MODULE_6) +Q(___PRESIZE_MODULE_7) +Q(___PRESIZE_MODULE_8) +Q(___PRESIZE_MODULE_9) +Q(___PRESIZE_MODULE_10) +Q(___PRESIZE_MODULE_11) +Q(___PRESIZE_MODULE_12) +Q(___PRESIZE_MODULE_13) +Q(___PRESIZE_MODULE_14) +Q(___PRESIZE_MODULE_15) +Q(___PRESIZE_MODULE_16) +Q(___PRESIZE_MODULE_17) +Q(___PRESIZE_MODULE_18) +Q(___PRESIZE_MODULE_19) +Q(___PRESIZE_MODULE_20) +Q(___PRESIZE_MODULE_21) +Q(___PRESIZE_MODULE_22) +Q(___PRESIZE_MODULE_23) +Q(___PRESIZE_MODULE_24) +Q(___PRESIZE_MODULE_25) +Q(___PRESIZE_MODULE_26) +Q(___PRESIZE_MODULE_27) +Q(___PRESIZE_MODULE_28) +Q(___PRESIZE_MODULE_29) Q()) Q(() diff --git a/core/embed/upymod/qstrdefsport.h.mako b/core/embed/upymod/qstrdefsport.h.mako new file mode 100644 index 0000000000..12f003be2b --- /dev/null +++ b/core/embed/upymod/qstrdefsport.h.mako @@ -0,0 +1,107 @@ +// generated from ${THIS_FILE.name} +// (by running `make templates` in `core`) +// do not edit manually! +// fmt: off +<% +from itertools import chain + +SRCDIR = THIS_FILE.resolve().parent.parent.parent / "src" + +PATTERNS = ( + "*.py", + "storage/**/*.py", + "trezor/**/*.py", + "apps/**/*.py", +) + +ALTCOINS = ( + "binance", + "cardano", + "eos", + "ethereum", + "monero", + "nem", + "ripple", + "solana", + "stellar", + "tezos", + "webauthn", + "zcash", +) + +pyfiles = chain.from_iterable(sorted(SRCDIR.glob(p)) for p in PATTERNS) + +def make_import_name(pyfile): + importfile = pyfile.relative_to(SRCDIR) + if importfile.name == "__init__.py": + import_name = str(importfile.parent) + else: + import_name = str(importfile.with_suffix("")) + return import_name.replace("/", ".") + +imports = [make_import_name(f) for f in pyfiles] + +imports_thp = [import_name for import_name in imports if ".thp" in import_name.lower()] +imports_common = [import_name for import_name in imports if (not any(a in import_name.lower() for a in ALTCOINS) and import_name not in imports_thp)] +imports_altcoin = [import_name for import_name in imports if import_name not in imports_common and import_name not in imports_thp] + +def make_import_qstrs(import_names): + imported = set() + for name in import_names: + for qstr in (name, name.rsplit('.', 1)[-1]): + if qstr not in imported: + yield qstr + imported.add(qstr) +%>\ + +#error This header should not be part of the build, its purpose is only to add missed Qstrings + +// explanation: +// uPy collects string literals and symbol names from all frozen modules, and +// converts them to qstrings for certain usages. In particular, it appears that +// qualified names of modules in sys.modules must be qstrings. However, the +// collection process is imperfect. If `apps.common.mnemonic` is always imported +// as `from ..common import mnemonic`, the string "apps.common.mnemonic" never +// appears in source code, is never collected, but then is generated and +// interned at runtime. A similar thing happens in reverse: if module +// `storage.cache` is always imported as this name, then "storage.cache" is +// collected but neither "storage" nor "cache" alone. Which is a problem, +// because "cache" is a symbol that is added to `storage`'s dict. +// +// We need to avoid run-time interning as much as possible, because it creates +// uncollectable garbage in the GC arena. + +% for import_name in make_import_qstrs(imports_common): +Q(${import_name}) +% endfor + +#if USE_THP +% for import_name in make_import_qstrs(imports_thp): +Q(${import_name}) +% endfor +#endif + +#if !BITCOIN_ONLY +% for import_name in make_import_qstrs(imports_altcoin): +Q(${import_name}) +% endfor +#endif + +// generate full alphabet +<% +ALPHABET = "abcdefghijklmnopqrstuvwxyz" +%>\ +% for letter in ALPHABET: +Q(${letter}) +Q(${letter.upper()}) +% endfor + +// generate module presizing identifiers +% for i in range(30): +Q(___PRESIZE_MODULE_${i}) +% endfor + +Q()) +Q(() +Q(<) +Q(;) diff --git a/core/src/all_modules.py b/core/src/all_modules.py deleted file mode 100644 index 88ffa0b8ec..0000000000 --- a/core/src/all_modules.py +++ /dev/null @@ -1,923 +0,0 @@ -# generated from all_modules.py.mako -# (by running `make templates` in `core`) -# do not edit manually! -# flake8: noqa -# fmt: off -# isort:skip_file -from trezor.utils import halt - -# this module should not be part of the build, its purpose is only to add missed Qstrings -halt("Tried to import excluded module.") - -# explanation: -# uPy collects string literals and symbol names from all frozen modules, and converts -# them to qstrings for certain usages. In particular, it appears that qualified names -# of modules in sys.modules must be qstrings. However, the collection process is -# imperfect. If `apps.common.mnemonic` is always imported as `from ..common import mnemonic`, -# the string "apps.common.mnemonic" never appears in source code, is never collected, -# but then is generated and interned at runtime. -# A similar thing happens in reverse: if module `storage.cache` is always imported as -# this name, then "storage.cache" is collected but neither "storage" nor "cache" alone. -# Which is a problem, because "cache" is a symbol that is added to `storage`'s dict. -# -# We need to avoid run-time interning as much as possible, because it creates -# uncollectable garbage in the GC arena. -# -# Below, every module is listed both as import (which collects the qualified name) -# and as a symbol (which collects each individual component). -# In addition, we list the alphabet, because apparently one-character strings are always -# interned, and some operation somewhere (rendering?) is reading strings character by -# character. - -from trezor import utils - -all_modules -import all_modules -boot -import boot -main -import main -session -import session -typing -import typing -usb -import usb -storage -import storage -storage.cache -import storage.cache -storage.cache_codec -import storage.cache_codec -storage.cache_common -import storage.cache_common -storage.common -import storage.common -storage.debug -import storage.debug -storage.device -import storage.device -storage.fido2 -import storage.fido2 -storage.recovery -import storage.recovery -storage.recovery_shares -import storage.recovery_shares -storage.resident_credentials -import storage.resident_credentials -storage.sd_salt -import storage.sd_salt -trezor -import trezor -trezor.crypto -import trezor.crypto -trezor.crypto.base32 -import trezor.crypto.base32 -trezor.crypto.base58 -import trezor.crypto.base58 -trezor.crypto.bech32 -import trezor.crypto.bech32 -trezor.crypto.cashaddr -import trezor.crypto.cashaddr -trezor.crypto.cosi -import trezor.crypto.cosi -trezor.crypto.curve -import trezor.crypto.curve -trezor.crypto.der -import trezor.crypto.der -trezor.crypto.hashlib -import trezor.crypto.hashlib -trezor.crypto.rlp -import trezor.crypto.rlp -trezor.crypto.scripts -import trezor.crypto.scripts -trezor.crypto.slip39 -import trezor.crypto.slip39 -trezor.enums.AmountUnit -import trezor.enums.AmountUnit -trezor.enums.BackupAvailability -import trezor.enums.BackupAvailability -trezor.enums.BackupType -import trezor.enums.BackupType -trezor.enums.BootCommand -import trezor.enums.BootCommand -trezor.enums.ButtonRequestType -import trezor.enums.ButtonRequestType -trezor.enums.Capability -import trezor.enums.Capability -trezor.enums.DebugButton -import trezor.enums.DebugButton -trezor.enums.DebugPhysicalButton -import trezor.enums.DebugPhysicalButton -trezor.enums.DebugSwipeDirection -import trezor.enums.DebugSwipeDirection -trezor.enums.DebugWaitType -import trezor.enums.DebugWaitType -trezor.enums.DecredStakingSpendType -import trezor.enums.DecredStakingSpendType -trezor.enums.DisplayRotation -import trezor.enums.DisplayRotation -trezor.enums.FailureType -import trezor.enums.FailureType -trezor.enums.HomescreenFormat -import trezor.enums.HomescreenFormat -trezor.enums.InputScriptType -import trezor.enums.InputScriptType -trezor.enums.MessageType -import trezor.enums.MessageType -trezor.enums.MultisigPubkeysOrder -import trezor.enums.MultisigPubkeysOrder -trezor.enums.OutputScriptType -import trezor.enums.OutputScriptType -trezor.enums.PinMatrixRequestType -import trezor.enums.PinMatrixRequestType -trezor.enums.RecoveryDeviceInputMethod -import trezor.enums.RecoveryDeviceInputMethod -trezor.enums.RecoveryStatus -import trezor.enums.RecoveryStatus -trezor.enums.RecoveryType -import trezor.enums.RecoveryType -trezor.enums.RequestType -import trezor.enums.RequestType -trezor.enums.SafetyCheckLevel -import trezor.enums.SafetyCheckLevel -trezor.enums.SdProtectOperationType -import trezor.enums.SdProtectOperationType -trezor.enums.WordRequestType -import trezor.enums.WordRequestType -trezor.enums -import trezor.enums -trezor.errors -import trezor.errors -trezor.log -import trezor.log -trezor.loop -import trezor.loop -trezor.messages -import trezor.messages -trezor.pin -import trezor.pin -trezor.protobuf -import trezor.protobuf -trezor.sdcard -import trezor.sdcard -trezor.strings -import trezor.strings -trezor.ui -import trezor.ui -trezor.ui.layouts -import trezor.ui.layouts -trezor.ui.layouts.bolt -import trezor.ui.layouts.bolt -trezor.ui.layouts.bolt.fido -import trezor.ui.layouts.bolt.fido -trezor.ui.layouts.bolt.recovery -import trezor.ui.layouts.bolt.recovery -trezor.ui.layouts.bolt.reset -import trezor.ui.layouts.bolt.reset -trezor.ui.layouts.caesar -import trezor.ui.layouts.caesar -trezor.ui.layouts.caesar.fido -import trezor.ui.layouts.caesar.fido -trezor.ui.layouts.caesar.recovery -import trezor.ui.layouts.caesar.recovery -trezor.ui.layouts.caesar.reset -import trezor.ui.layouts.caesar.reset -trezor.ui.layouts.common -import trezor.ui.layouts.common -trezor.ui.layouts.delizia -import trezor.ui.layouts.delizia -trezor.ui.layouts.delizia.fido -import trezor.ui.layouts.delizia.fido -trezor.ui.layouts.delizia.recovery -import trezor.ui.layouts.delizia.recovery -trezor.ui.layouts.delizia.reset -import trezor.ui.layouts.delizia.reset -trezor.ui.layouts.fido -import trezor.ui.layouts.fido -trezor.ui.layouts.homescreen -import trezor.ui.layouts.homescreen -trezor.ui.layouts.progress -import trezor.ui.layouts.progress -trezor.ui.layouts.recovery -import trezor.ui.layouts.recovery -trezor.ui.layouts.reset -import trezor.ui.layouts.reset -trezor.utils -import trezor.utils -trezor.wire -import trezor.wire -trezor.wire.codec -import trezor.wire.codec -trezor.wire.codec.codec_context -import trezor.wire.codec.codec_context -trezor.wire.codec.codec_v1 -import trezor.wire.codec.codec_v1 -trezor.wire.context -import trezor.wire.context -trezor.wire.errors -import trezor.wire.errors -trezor.wire.message_handler -import trezor.wire.message_handler -trezor.wire.protocol_common -import trezor.wire.protocol_common -trezor.workflow -import trezor.workflow -apps -import apps -apps.base -import apps.base -apps.benchmark -import apps.benchmark -apps.benchmark.benchmark -import apps.benchmark.benchmark -apps.benchmark.benchmarks -import apps.benchmark.benchmarks -apps.benchmark.cipher_benchmark -import apps.benchmark.cipher_benchmark -apps.benchmark.common -import apps.benchmark.common -apps.benchmark.curve_benchmark -import apps.benchmark.curve_benchmark -apps.benchmark.hash_benchmark -import apps.benchmark.hash_benchmark -apps.benchmark.list_names -import apps.benchmark.list_names -apps.benchmark.run -import apps.benchmark.run -apps.bitcoin -import apps.bitcoin -apps.bitcoin.addresses -import apps.bitcoin.addresses -apps.bitcoin.authorization -import apps.bitcoin.authorization -apps.bitcoin.authorize_coinjoin -import apps.bitcoin.authorize_coinjoin -apps.bitcoin.common -import apps.bitcoin.common -apps.bitcoin.get_address -import apps.bitcoin.get_address -apps.bitcoin.get_ownership_id -import apps.bitcoin.get_ownership_id -apps.bitcoin.get_ownership_proof -import apps.bitcoin.get_ownership_proof -apps.bitcoin.get_public_key -import apps.bitcoin.get_public_key -apps.bitcoin.keychain -import apps.bitcoin.keychain -apps.bitcoin.multisig -import apps.bitcoin.multisig -apps.bitcoin.ownership -import apps.bitcoin.ownership -apps.bitcoin.readers -import apps.bitcoin.readers -apps.bitcoin.scripts -import apps.bitcoin.scripts -apps.bitcoin.scripts_decred -import apps.bitcoin.scripts_decred -apps.bitcoin.sign_message -import apps.bitcoin.sign_message -apps.bitcoin.sign_tx -import apps.bitcoin.sign_tx -apps.bitcoin.sign_tx.approvers -import apps.bitcoin.sign_tx.approvers -apps.bitcoin.sign_tx.bitcoin -import apps.bitcoin.sign_tx.bitcoin -apps.bitcoin.sign_tx.bitcoinlike -import apps.bitcoin.sign_tx.bitcoinlike -apps.bitcoin.sign_tx.change_detector -import apps.bitcoin.sign_tx.change_detector -apps.bitcoin.sign_tx.decred -import apps.bitcoin.sign_tx.decred -apps.bitcoin.sign_tx.helpers -import apps.bitcoin.sign_tx.helpers -apps.bitcoin.sign_tx.layout -import apps.bitcoin.sign_tx.layout -apps.bitcoin.sign_tx.matchcheck -import apps.bitcoin.sign_tx.matchcheck -apps.bitcoin.sign_tx.omni -import apps.bitcoin.sign_tx.omni -apps.bitcoin.sign_tx.payment_request -import apps.bitcoin.sign_tx.payment_request -apps.bitcoin.sign_tx.progress -import apps.bitcoin.sign_tx.progress -apps.bitcoin.sign_tx.sig_hasher -import apps.bitcoin.sign_tx.sig_hasher -apps.bitcoin.sign_tx.tx_info -import apps.bitcoin.sign_tx.tx_info -apps.bitcoin.sign_tx.tx_weight -import apps.bitcoin.sign_tx.tx_weight -apps.bitcoin.verification -import apps.bitcoin.verification -apps.bitcoin.verify_message -import apps.bitcoin.verify_message -apps.bitcoin.writers -import apps.bitcoin.writers -apps.common -import apps.common -apps.common.address_mac -import apps.common.address_mac -apps.common.address_type -import apps.common.address_type -apps.common.authorization -import apps.common.authorization -apps.common.backup -import apps.common.backup -apps.common.backup_types -import apps.common.backup_types -apps.common.cache -import apps.common.cache -apps.common.cbor -import apps.common.cbor -apps.common.coininfo -import apps.common.coininfo -apps.common.coins -import apps.common.coins -apps.common.keychain -import apps.common.keychain -apps.common.passphrase -import apps.common.passphrase -apps.common.paths -import apps.common.paths -apps.common.readers -import apps.common.readers -apps.common.request_pin -import apps.common.request_pin -apps.common.safety_checks -import apps.common.safety_checks -apps.common.sdcard -import apps.common.sdcard -apps.common.seed -import apps.common.seed -apps.common.signverify -import apps.common.signverify -apps.common.writers -import apps.common.writers -apps.debug -import apps.debug -apps.debug.load_device -import apps.debug.load_device -apps.homescreen -import apps.homescreen -apps.management -import apps.management -apps.management.apply_flags -import apps.management.apply_flags -apps.management.apply_settings -import apps.management.apply_settings -apps.management.authenticate_device -import apps.management.authenticate_device -apps.management.backup_device -import apps.management.backup_device -apps.management.ble.unpair -import apps.management.ble.unpair -apps.management.change_language -import apps.management.change_language -apps.management.change_pin -import apps.management.change_pin -apps.management.change_wipe_code -import apps.management.change_wipe_code -apps.management.get_next_u2f_counter -import apps.management.get_next_u2f_counter -apps.management.get_nonce -import apps.management.get_nonce -apps.management.reboot_to_bootloader -import apps.management.reboot_to_bootloader -apps.management.recovery_device -import apps.management.recovery_device -apps.management.recovery_device.homescreen -import apps.management.recovery_device.homescreen -apps.management.recovery_device.layout -import apps.management.recovery_device.layout -apps.management.recovery_device.recover -import apps.management.recovery_device.recover -apps.management.recovery_device.word_validity -import apps.management.recovery_device.word_validity -apps.management.reset_device -import apps.management.reset_device -apps.management.reset_device.layout -import apps.management.reset_device.layout -apps.management.sd_protect -import apps.management.sd_protect -apps.management.set_brightness -import apps.management.set_brightness -apps.management.set_u2f_counter -import apps.management.set_u2f_counter -apps.management.show_tutorial -import apps.management.show_tutorial -apps.management.wipe_device -import apps.management.wipe_device -apps.misc -import apps.misc -apps.misc.cipher_key_value -import apps.misc.cipher_key_value -apps.misc.get_ecdh_session_key -import apps.misc.get_ecdh_session_key -apps.misc.get_entropy -import apps.misc.get_entropy -apps.misc.get_firmware_hash -import apps.misc.get_firmware_hash -apps.misc.sign_identity -import apps.misc.sign_identity -apps.nostr -import apps.nostr -apps.nostr.get_pubkey -import apps.nostr.get_pubkey -apps.nostr.sign_event -import apps.nostr.sign_event -apps.workflow_handlers -import apps.workflow_handlers - -if utils.USE_THP: - apps.thp - import apps.thp - apps.thp.credential_manager - import apps.thp.credential_manager - -if not utils.BITCOIN_ONLY: - trezor.enums.BinanceOrderSide - import trezor.enums.BinanceOrderSide - trezor.enums.BinanceOrderType - import trezor.enums.BinanceOrderType - trezor.enums.BinanceTimeInForce - import trezor.enums.BinanceTimeInForce - trezor.enums.CardanoAddressType - import trezor.enums.CardanoAddressType - trezor.enums.CardanoCVoteRegistrationFormat - import trezor.enums.CardanoCVoteRegistrationFormat - trezor.enums.CardanoCertificateType - import trezor.enums.CardanoCertificateType - trezor.enums.CardanoDRepType - import trezor.enums.CardanoDRepType - trezor.enums.CardanoDerivationType - import trezor.enums.CardanoDerivationType - trezor.enums.CardanoNativeScriptHashDisplayFormat - import trezor.enums.CardanoNativeScriptHashDisplayFormat - trezor.enums.CardanoNativeScriptType - import trezor.enums.CardanoNativeScriptType - trezor.enums.CardanoPoolRelayType - import trezor.enums.CardanoPoolRelayType - trezor.enums.CardanoTxAuxiliaryDataSupplementType - import trezor.enums.CardanoTxAuxiliaryDataSupplementType - trezor.enums.CardanoTxOutputSerializationFormat - import trezor.enums.CardanoTxOutputSerializationFormat - trezor.enums.CardanoTxSigningMode - import trezor.enums.CardanoTxSigningMode - trezor.enums.CardanoTxWitnessType - import trezor.enums.CardanoTxWitnessType - trezor.enums.EthereumDataType - import trezor.enums.EthereumDataType - trezor.enums.EthereumDefinitionType - import trezor.enums.EthereumDefinitionType - trezor.enums.MoneroNetworkType - import trezor.enums.MoneroNetworkType - trezor.enums.NEMImportanceTransferMode - import trezor.enums.NEMImportanceTransferMode - trezor.enums.NEMModificationType - import trezor.enums.NEMModificationType - trezor.enums.NEMMosaicLevy - import trezor.enums.NEMMosaicLevy - trezor.enums.NEMSupplyChangeType - import trezor.enums.NEMSupplyChangeType - trezor.enums.StellarAssetType - import trezor.enums.StellarAssetType - trezor.enums.StellarMemoType - import trezor.enums.StellarMemoType - trezor.enums.StellarSignerType - import trezor.enums.StellarSignerType - trezor.enums.TezosBallotType - import trezor.enums.TezosBallotType - trezor.enums.TezosContractType - import trezor.enums.TezosContractType - apps.binance - import apps.binance - apps.binance.get_address - import apps.binance.get_address - apps.binance.get_public_key - import apps.binance.get_public_key - apps.binance.helpers - import apps.binance.helpers - apps.binance.layout - import apps.binance.layout - apps.binance.sign_tx - import apps.binance.sign_tx - apps.bitcoin.sign_tx.zcash_v4 - import apps.bitcoin.sign_tx.zcash_v4 - apps.cardano - import apps.cardano - apps.cardano.addresses - import apps.cardano.addresses - apps.cardano.auxiliary_data - import apps.cardano.auxiliary_data - apps.cardano.byron_addresses - import apps.cardano.byron_addresses - apps.cardano.certificates - import apps.cardano.certificates - apps.cardano.get_address - import apps.cardano.get_address - apps.cardano.get_native_script_hash - import apps.cardano.get_native_script_hash - apps.cardano.get_public_key - import apps.cardano.get_public_key - apps.cardano.helpers - import apps.cardano.helpers - apps.cardano.helpers.account_path_check - import apps.cardano.helpers.account_path_check - apps.cardano.helpers.bech32 - import apps.cardano.helpers.bech32 - apps.cardano.helpers.credential - import apps.cardano.helpers.credential - apps.cardano.helpers.hash_builder_collection - import apps.cardano.helpers.hash_builder_collection - apps.cardano.helpers.network_ids - import apps.cardano.helpers.network_ids - apps.cardano.helpers.paths - import apps.cardano.helpers.paths - apps.cardano.helpers.protocol_magics - import apps.cardano.helpers.protocol_magics - apps.cardano.helpers.utils - import apps.cardano.helpers.utils - apps.cardano.layout - import apps.cardano.layout - apps.cardano.native_script - import apps.cardano.native_script - apps.cardano.seed - import apps.cardano.seed - apps.cardano.sign_tx - import apps.cardano.sign_tx - apps.cardano.sign_tx.multisig_signer - import apps.cardano.sign_tx.multisig_signer - apps.cardano.sign_tx.ordinary_signer - import apps.cardano.sign_tx.ordinary_signer - apps.cardano.sign_tx.plutus_signer - import apps.cardano.sign_tx.plutus_signer - apps.cardano.sign_tx.pool_owner_signer - import apps.cardano.sign_tx.pool_owner_signer - apps.cardano.sign_tx.signer - import apps.cardano.sign_tx.signer - apps.common.mnemonic - import apps.common.mnemonic - apps.eos - import apps.eos - apps.eos.actions - import apps.eos.actions - apps.eos.actions.layout - import apps.eos.actions.layout - apps.eos.get_public_key - import apps.eos.get_public_key - apps.eos.helpers - import apps.eos.helpers - apps.eos.layout - import apps.eos.layout - apps.eos.sign_tx - import apps.eos.sign_tx - apps.eos.writers - import apps.eos.writers - apps.ethereum - import apps.ethereum - apps.ethereum.definitions - import apps.ethereum.definitions - apps.ethereum.definitions_constants - import apps.ethereum.definitions_constants - apps.ethereum.get_address - import apps.ethereum.get_address - apps.ethereum.get_public_key - import apps.ethereum.get_public_key - apps.ethereum.helpers - import apps.ethereum.helpers - apps.ethereum.keychain - import apps.ethereum.keychain - apps.ethereum.layout - import apps.ethereum.layout - apps.ethereum.networks - import apps.ethereum.networks - apps.ethereum.sign_message - import apps.ethereum.sign_message - apps.ethereum.sign_tx - import apps.ethereum.sign_tx - apps.ethereum.sign_tx_eip1559 - import apps.ethereum.sign_tx_eip1559 - apps.ethereum.sign_typed_data - import apps.ethereum.sign_typed_data - apps.ethereum.staking_tx_constants - import apps.ethereum.staking_tx_constants - apps.ethereum.tokens - import apps.ethereum.tokens - apps.ethereum.verify_message - import apps.ethereum.verify_message - apps.monero - import apps.monero - apps.monero.diag - import apps.monero.diag - apps.monero.get_address - import apps.monero.get_address - apps.monero.get_tx_keys - import apps.monero.get_tx_keys - apps.monero.get_watch_only - import apps.monero.get_watch_only - apps.monero.key_image_sync - import apps.monero.key_image_sync - apps.monero.layout - import apps.monero.layout - apps.monero.live_refresh - import apps.monero.live_refresh - apps.monero.misc - import apps.monero.misc - apps.monero.sign_tx - import apps.monero.sign_tx - apps.monero.signing - import apps.monero.signing - apps.monero.signing.offloading_keys - import apps.monero.signing.offloading_keys - apps.monero.signing.state - import apps.monero.signing.state - apps.monero.signing.step_01_init_transaction - import apps.monero.signing.step_01_init_transaction - apps.monero.signing.step_02_set_input - import apps.monero.signing.step_02_set_input - apps.monero.signing.step_04_input_vini - import apps.monero.signing.step_04_input_vini - apps.monero.signing.step_05_all_inputs_set - import apps.monero.signing.step_05_all_inputs_set - apps.monero.signing.step_06_set_output - import apps.monero.signing.step_06_set_output - apps.monero.signing.step_07_all_outputs_set - import apps.monero.signing.step_07_all_outputs_set - apps.monero.signing.step_09_sign_input - import apps.monero.signing.step_09_sign_input - apps.monero.signing.step_10_sign_final - import apps.monero.signing.step_10_sign_final - apps.monero.xmr - import apps.monero.xmr - apps.monero.xmr.addresses - import apps.monero.xmr.addresses - apps.monero.xmr.bulletproof - import apps.monero.xmr.bulletproof - apps.monero.xmr.chacha_poly - import apps.monero.xmr.chacha_poly - apps.monero.xmr.clsag - import apps.monero.xmr.clsag - apps.monero.xmr.credentials - import apps.monero.xmr.credentials - apps.monero.xmr.crypto_helpers - import apps.monero.xmr.crypto_helpers - apps.monero.xmr.keccak_hasher - import apps.monero.xmr.keccak_hasher - apps.monero.xmr.key_image - import apps.monero.xmr.key_image - apps.monero.xmr.mlsag_hasher - import apps.monero.xmr.mlsag_hasher - apps.monero.xmr.monero - import apps.monero.xmr.monero - apps.monero.xmr.networks - import apps.monero.xmr.networks - apps.monero.xmr.range_signatures - import apps.monero.xmr.range_signatures - apps.monero.xmr.serialize - import apps.monero.xmr.serialize - apps.monero.xmr.serialize.base_types - import apps.monero.xmr.serialize.base_types - apps.monero.xmr.serialize.int_serialize - import apps.monero.xmr.serialize.int_serialize - apps.monero.xmr.serialize.message_types - import apps.monero.xmr.serialize.message_types - apps.monero.xmr.serialize.readwriter - import apps.monero.xmr.serialize.readwriter - apps.monero.xmr.serialize_messages.base - import apps.monero.xmr.serialize_messages.base - apps.monero.xmr.serialize_messages.tx_ct_key - import apps.monero.xmr.serialize_messages.tx_ct_key - apps.monero.xmr.serialize_messages.tx_ecdh - import apps.monero.xmr.serialize_messages.tx_ecdh - apps.monero.xmr.serialize_messages.tx_prefix - import apps.monero.xmr.serialize_messages.tx_prefix - apps.monero.xmr.serialize_messages.tx_rsig_bulletproof - import apps.monero.xmr.serialize_messages.tx_rsig_bulletproof - apps.nem - import apps.nem - apps.nem.get_address - import apps.nem.get_address - apps.nem.helpers - import apps.nem.helpers - apps.nem.layout - import apps.nem.layout - apps.nem.mosaic - import apps.nem.mosaic - apps.nem.mosaic.helpers - import apps.nem.mosaic.helpers - apps.nem.mosaic.layout - import apps.nem.mosaic.layout - apps.nem.mosaic.nem_mosaics - import apps.nem.mosaic.nem_mosaics - apps.nem.mosaic.serialize - import apps.nem.mosaic.serialize - apps.nem.multisig - import apps.nem.multisig - apps.nem.multisig.layout - import apps.nem.multisig.layout - apps.nem.multisig.serialize - import apps.nem.multisig.serialize - apps.nem.namespace - import apps.nem.namespace - apps.nem.namespace.layout - import apps.nem.namespace.layout - apps.nem.namespace.serialize - import apps.nem.namespace.serialize - apps.nem.sign_tx - import apps.nem.sign_tx - apps.nem.transfer - import apps.nem.transfer - apps.nem.transfer.layout - import apps.nem.transfer.layout - apps.nem.transfer.serialize - import apps.nem.transfer.serialize - apps.nem.validators - import apps.nem.validators - apps.nem.writers - import apps.nem.writers - apps.ripple - import apps.ripple - apps.ripple.base58_ripple - import apps.ripple.base58_ripple - apps.ripple.get_address - import apps.ripple.get_address - apps.ripple.helpers - import apps.ripple.helpers - apps.ripple.layout - import apps.ripple.layout - apps.ripple.serialize - import apps.ripple.serialize - apps.ripple.sign_tx - import apps.ripple.sign_tx - apps.solana - import apps.solana - apps.solana.constants - import apps.solana.constants - apps.solana.format - import apps.solana.format - apps.solana.get_address - import apps.solana.get_address - apps.solana.get_public_key - import apps.solana.get_public_key - apps.solana.layout - import apps.solana.layout - apps.solana.predefined_transaction - import apps.solana.predefined_transaction - apps.solana.sign_tx - import apps.solana.sign_tx - apps.solana.token_account - import apps.solana.token_account - apps.solana.transaction - import apps.solana.transaction - apps.solana.transaction.instruction - import apps.solana.transaction.instruction - apps.solana.transaction.instructions - import apps.solana.transaction.instructions - apps.solana.transaction.parse - import apps.solana.transaction.parse - apps.solana.types - import apps.solana.types - apps.stellar - import apps.stellar - apps.stellar.consts - import apps.stellar.consts - apps.stellar.get_address - import apps.stellar.get_address - apps.stellar.helpers - import apps.stellar.helpers - apps.stellar.layout - import apps.stellar.layout - apps.stellar.operations - import apps.stellar.operations - apps.stellar.operations.layout - import apps.stellar.operations.layout - apps.stellar.operations.serialize - import apps.stellar.operations.serialize - apps.stellar.sign_tx - import apps.stellar.sign_tx - apps.stellar.writers - import apps.stellar.writers - apps.tezos - import apps.tezos - apps.tezos.get_address - import apps.tezos.get_address - apps.tezos.get_public_key - import apps.tezos.get_public_key - apps.tezos.helpers - import apps.tezos.helpers - apps.tezos.layout - import apps.tezos.layout - apps.tezos.sign_tx - import apps.tezos.sign_tx - apps.webauthn - import apps.webauthn - apps.webauthn.add_resident_credential - import apps.webauthn.add_resident_credential - apps.webauthn.common - import apps.webauthn.common - apps.webauthn.credential - import apps.webauthn.credential - apps.webauthn.fido2 - import apps.webauthn.fido2 - apps.webauthn.knownapps - import apps.webauthn.knownapps - apps.webauthn.list_resident_credentials - import apps.webauthn.list_resident_credentials - apps.webauthn.remove_resident_credential - import apps.webauthn.remove_resident_credential - apps.webauthn.resident_credentials - import apps.webauthn.resident_credentials - apps.zcash - import apps.zcash - apps.zcash.f4jumble - import apps.zcash.f4jumble - apps.zcash.hasher - import apps.zcash.hasher - apps.zcash.signer - import apps.zcash.signer - apps.zcash.unified_addresses - import apps.zcash.unified_addresses -# generate full alphabet -a -A -b -B -c -C -d -D -e -E -f -F -g -G -h -H -i -I -j -J -k -K -l -L -m -M -n -N -o -O -p -P -q -Q -r -R -s -S -t -T -u -U -v -V -w -W -x -X -y -Y -z -Z -# generate module presizing identifiers -___PRESIZE_MODULE_0 -___PRESIZE_MODULE_1 -___PRESIZE_MODULE_2 -___PRESIZE_MODULE_3 -___PRESIZE_MODULE_4 -___PRESIZE_MODULE_5 -___PRESIZE_MODULE_6 -___PRESIZE_MODULE_7 -___PRESIZE_MODULE_8 -___PRESIZE_MODULE_9 -___PRESIZE_MODULE_10 -___PRESIZE_MODULE_11 -___PRESIZE_MODULE_12 -___PRESIZE_MODULE_13 -___PRESIZE_MODULE_14 -___PRESIZE_MODULE_15 -___PRESIZE_MODULE_16 -___PRESIZE_MODULE_17 -___PRESIZE_MODULE_18 -___PRESIZE_MODULE_19 -___PRESIZE_MODULE_20 -___PRESIZE_MODULE_21 -___PRESIZE_MODULE_22 -___PRESIZE_MODULE_23 -___PRESIZE_MODULE_24 -___PRESIZE_MODULE_25 -___PRESIZE_MODULE_26 -___PRESIZE_MODULE_27 -___PRESIZE_MODULE_28 -___PRESIZE_MODULE_29 diff --git a/core/src/all_modules.py.mako b/core/src/all_modules.py.mako deleted file mode 100644 index d7b2ddfc29..0000000000 --- a/core/src/all_modules.py.mako +++ /dev/null @@ -1,105 +0,0 @@ -# generated from ${THIS_FILE.name} -# (by running `make templates` in `core`) -# do not edit manually! -# flake8: noqa -# fmt: off -# isort:skip_file -<% -from itertools import chain - -SRCDIR = THIS_FILE.parent - -PATTERNS = ( - "*.py", - "storage/**/*.py", - "trezor/**/*.py", - "apps/**/*.py", -) - -ALTCOINS = ( - "binance", - "cardano", - "eos", - "ethereum", - "monero", - "nem", - "ripple", - "solana", - "stellar", - "tezos", - "webauthn", - "zcash", -) - -pyfiles = chain.from_iterable(sorted(SRCDIR.glob(p)) for p in PATTERNS) - -def make_import_name(pyfile): - importfile = pyfile.relative_to(SRCDIR) - if importfile.name == "__init__.py": - import_name = str(importfile.parent) - else: - import_name = str(importfile.with_suffix("")) - return import_name.replace("/", ".") - -imports = [make_import_name(f) for f in pyfiles] - -imports_thp = [import_name for import_name in imports if ".thp" in import_name.lower()] -imports_common = [import_name for import_name in imports if (not any(a in import_name.lower() for a in ALTCOINS) and import_name not in imports_thp)] -imports_altcoin = [import_name for import_name in imports if import_name not in imports_common and import_name not in imports_thp] - -%>\ -from trezor.utils import halt - -# this module should not be part of the build, its purpose is only to add missed Qstrings -halt("Tried to import excluded module.") - -# explanation: -# uPy collects string literals and symbol names from all frozen modules, and converts -# them to qstrings for certain usages. In particular, it appears that qualified names -# of modules in sys.modules must be qstrings. However, the collection process is -# imperfect. If `apps.common.mnemonic` is always imported as `from ..common import mnemonic`, -# the string "apps.common.mnemonic" never appears in source code, is never collected, -# but then is generated and interned at runtime. -# A similar thing happens in reverse: if module `storage.cache` is always imported as -# this name, then "storage.cache" is collected but neither "storage" nor "cache" alone. -# Which is a problem, because "cache" is a symbol that is added to `storage`'s dict. -# -# We need to avoid run-time interning as much as possible, because it creates -# uncollectable garbage in the GC arena. -# -# Below, every module is listed both as import (which collects the qualified name) -# and as a symbol (which collects each individual component). -# In addition, we list the alphabet, because apparently one-character strings are always -# interned, and some operation somewhere (rendering?) is reading strings character by -# character. - -from trezor import utils - -% for import_name in imports_common: -${import_name} -import ${import_name} -% endfor - -if utils.USE_THP: -% for import_name in imports_thp: - ${import_name} - import ${import_name} -% endfor - -if not utils.BITCOIN_ONLY: -% for import_name in imports_altcoin: - ${import_name} - import ${import_name} -% endfor -# generate full alphabet -<% -ALPHABET = "abcdefghijklmnopqrstuvwxyz" -%>\ -% for letter in ALPHABET: -${letter} -${letter.upper()} -% endfor -# generate module presizing identifiers -% for i in range(30): -___PRESIZE_MODULE_${i} -% endfor