Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
771 changes: 13 additions & 758 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ bech32 = { version = "0.11", default-features = false }
chrono = { version = "0.4", default-features = false }
const-hex = { version = "1.19", default-features = false }
derive_more = { version = "2.1", default-features = false }
image = "0.25"
itertools = { version = "0.15", default-features = false }
ledger_device_sdk = "1.35"
ledger_secure_sdk_sys = "1.16"
num_enum = { version = "0.7", default-features = false }
num-traits = { version = "0.2", default-features = false }
strum = { version = "0.27", default-features = false }
# Note: the testmacro crate is published by Ledger and its source code comes from the `testmacro`
# dir inside the sdk repo, i.e. https://github.com/LedgerHQ/ledger-device-rust-sdk/tree/cad196841dbd72c037cfa01bec81a4a3ae57a04e/testmacro
# (though the published version is a bit older).
Expand Down Expand Up @@ -51,9 +52,6 @@ ledger_device_sdk.workspace = true

mintlayer-app-core.workspace = true

[build-dependencies]
image.workspace = true

[[bin]]
# Note: we only have this section to disable tests, but Cargo insists that "name" should also
# be specified.
Expand Down
36 changes: 0 additions & 36 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,8 @@

use std::process::Command;

use image::{ImageFormat, ImageReader, Pixel};

// TODO: all image files currently contain the Rust logo; need to replace them with Mintlayer logo.
// See https://github.com/mintlayer/mintlayer-ledger-app/issues/10.

fn main() {
println!("cargo:rerun-if-changed=script.ld");
println!("cargo:rerun-if-changed=media/icons/mintlayer_14x14.gif");
println!("cargo:rerun-if-changed=media/icons/mask_14x14.gif");

let icons_path = std::path::PathBuf::from("media/icons");
let mut gray = ImageReader::open(icons_path.join("mintlayer_14x14.gif"))
.unwrap()
.decode()
.unwrap()
.into_luma8();

// Apply mask
let mask = ImageReader::open(icons_path.join("mask_14x14.gif"))
.unwrap()
.decode()
.unwrap()
.into_luma8();

for (x, y, mask_pixel) in mask.enumerate_pixels() {
let mask_value = mask_pixel[0];
let mut gray_pixel = *gray.get_pixel(x, y);
if mask_value == 0 {
gray_pixel = image::Luma([0]);
} else {
gray_pixel.invert();
}
gray.put_pixel(x, y, gray_pixel);
}

let glyph_path = std::path::PathBuf::from("media/glyphs");
gray.save_with_format(glyph_path.join("home_nano_nbgl.png"), ImageFormat::Png)
.unwrap();

let output = Command::new("git")
.args(["rev-parse", "HEAD"])
Expand Down
1 change: 1 addition & 0 deletions crates/app-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2024"
bech32 = { workspace = true, default-features = false, features = ["alloc"] }
chrono = { workspace = true, default-features = false, features = ["alloc"] }
const-hex = { workspace = true, default-features = false, features = ["alloc"] }
itertools = { workspace = true, default-features = false }
ledger_device_sdk.workspace = true
ledger_secure_sdk_sys.workspace = true

Expand Down
3 changes: 2 additions & 1 deletion crates/app-core/src/app_ui/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ use mintlayer_messages::{Destination, PublicKey};

use crate::{
StatusWord,
app_ui::utils::{compress_public_key, load_glyph, to_address},
app_ui::utils::{load_glyph, to_address},
mlcp,
utils::compress_public_key,
};

pub fn ui_display_pk<const T: char>(
Expand Down
Loading
Loading