Skip to content

Commit

Permalink
Fix compilation for trezor device with new mintlayer code
Browse files Browse the repository at this point in the history
  • Loading branch information
OBorce committed Jun 14, 2024
1 parent 0360ca4 commit c13d5d9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions common/protob/messages-mintlayer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message MintlayerGetPublicKey {
*/
message MintlayerPublicKey {
required bytes public_key = 1;
required bytes chain_code = 2;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion core/SConscript.bootloader
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ def cargo_build():
'--no-default-features',
'--features ' + ','.join(features),
'-Z build-std=core',
'-Z build-std-features=panic_immediate_abort',
'-Z build-std=alloc',
'-Z build-std=panic_abort,std',
# '-Z build-std-features=panic_immediate_abort',
]

bindgen_macros = tools.get_bindgen_defines(env.get("CPPDEFINES"), ALLPATHS)
Expand Down
6 changes: 5 additions & 1 deletion core/SConscript.firmware
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/zcash/*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/mintlayer/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/mintlayer/sign_tx/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Mintlayer*.py'))

SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py'))

Expand Down Expand Up @@ -790,7 +792,9 @@ def cargo_build():
'--no-default-features',
'--features ' + ','.join(features),
'-Z build-std=core',
'-Z build-std-features=panic_immediate_abort',
'-Z build-std=alloc',
'-Z build-std=panic_abort,std',
# '-Z build-std-features=panic_immediate_abort',
]

env.get('ENV')['TREZOR_MODEL'] = TREZOR_MODEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ STATIC mp_obj_t mod_trezormintlayer_utils_mintlayer_encode_utxo_input(
mp_buffer_info_t hash = {0};
mp_get_buffer_raise(tx_hash, &hash, MP_BUFFER_READ);
if (hash.len != 32) {
printf("invalid hash len: %ld", hash.len);
printf("invalid hash len: %ld", (long int)hash.len);
mp_raise_ValueError("Invalid hash");
}
uint32_t idx = trezor_obj_get_uint(index);
Expand Down
1 change: 1 addition & 0 deletions core/embed/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub mod translations;
pub mod ui;
pub mod strutil;

#[cfg(feature = "micropython")]
pub mod mintlayer;

#[cfg(feature = "debug")]
Expand Down
6 changes: 3 additions & 3 deletions python/docs/OPTIONS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ Miscellaneous debug features.
--help Show this message and exit.
Commands:
record Record screen changes into a specified directory.
send-bytes Send raw bytes to Trezor.
prodtest-t1 Perform a prodtest on Model One.
record Record screen changes into a specified directory.
send-bytes Send raw bytes to Trezor.
Device management commands - setup, recover seed, wipe, etc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -212,7 +213,6 @@ Device management commands - setup, recover seed, wipe, etc.
authenticate Get information to verify the authenticity of the device.
backup Perform device seed backup.
load Upload seed and custom configuration to the device.
prodtest-t1 Perform a prodtest on Model One.
reboot-to-bootloader Reboot device into bootloader mode.
recover Start safe recovery workflow.
sd-protect Secure the device with SD card protection.
Expand Down
2 changes: 1 addition & 1 deletion rust/trezor-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tracing-subscriber = "0.3"
serial_test = "2.0.0"

[features]
default = ["bitcoin", "ethereum", "solana"]
default = ["bitcoin", "ethereum", "solana", "mintlayer"]

# Client implementations
bitcoin = ["dep:bitcoin", "unicode-normalization"]
Expand Down

0 comments on commit c13d5d9

Please sign in to comment.