From 518d86c1adf6a7ec710db6e4031828100aac26b2 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 2 Dec 2024 11:49:20 -0300 Subject: [PATCH] fix: audit feedback (#99) * fix: remove commented code * fix: replace unwrap with map_err * chore: bump version * chore: snapshots --- app/.cargo/config.toml | 2 +- app/src/app_ui/menu.rs | 1 - app/src/crypto/chacha20poly.rs | 6 +++--- app/src/crypto/keys.rs | 8 ++++---- app/src/token.rs | 6 ++---- tests_zemu/snapshots/sp-mainmenu/00002.png | Bin 401 -> 378 bytes tests_zemu/snapshots/sp-mainmenu/00006.png | Bin 401 -> 378 bytes tests_zemu/tests/basic.test.ts | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/.cargo/config.toml b/app/.cargo/config.toml index 443a562e..499b825e 100644 --- a/app/.cargo/config.toml +++ b/app/.cargo/config.toml @@ -1,6 +1,6 @@ [env] HEAP_SIZE = "16384" -APPVERSION = "1.1.0" +APPVERSION = "1.1.1" [unstable] build-std = ["core", "alloc"] diff --git a/app/src/app_ui/menu.rs b/app/src/app_ui/menu.rs index 308d080b..217e5eda 100644 --- a/app/src/app_ui/menu.rs +++ b/app/src/app_ui/menu.rs @@ -59,7 +59,6 @@ pub fn ui_menu_main(comm: &mut Comm) -> Event { false => "Disabled", }; - // app_version = String::from("x"); let pages = [ &Page::from((_first_page_label, &APP_ICON)), &Page::from((["Expert Mode", expert_mode_label], true, true)), diff --git a/app/src/crypto/chacha20poly.rs b/app/src/crypto/chacha20poly.rs index 76a76c93..6dd977cd 100644 --- a/app/src/crypto/chacha20poly.rs +++ b/app/src/crypto/chacha20poly.rs @@ -76,9 +76,9 @@ pub fn compute_key() -> EncryptionKeyGuard { let path_0: Vec = vec![ (0x80000000 | 0x2c), (0x80000000 | 0x53a), - (0x80000000), // (0x80000000 | 0x0) - (0x80000000), // (0x80000000 | 0x0) - (0x80000000), // (0x80000000 | 0x0) + (0x80000000), + (0x80000000), + (0x80000000), ]; let mut secret_key_0 = Secret::::new(); diff --git a/app/src/crypto/keys.rs b/app/src/crypto/keys.rs index 8d87b700..713804f1 100644 --- a/app/src/crypto/keys.rs +++ b/app/src/crypto/keys.rs @@ -111,15 +111,15 @@ pub(crate) fn compute_dkg_secret(index: u8) -> IronfishSecretGuard { let path_0: Vec = vec![ (0x80000000 | 0x2c), (0x80000000 | 0x53a), - (0x80000000), // (0x80000000 | 0x0) - (0x80000000), // (0x80000000 | 0x0) + (0x80000000), + (0x80000000), (0x80000000 | index_1), ]; let path_1: Vec = vec![ (0x80000000 | 0x2c), (0x80000000 | 0x53a), - (0x80000000), // (0x80000000 | 0x0) - (0x80000000), //(0x80000000 | 0x0) + (0x80000000), + (0x80000000), (0x80000000 | index_2), ]; diff --git a/app/src/token.rs b/app/src/token.rs index cbe818f9..65c1e611 100644 --- a/app/src/token.rs +++ b/app/src/token.rs @@ -22,11 +22,9 @@ pub struct TokenInfo<'a> { } pub fn get_token_list() -> Result, ParserError> { - let t = serde_json_core::from_str::(TOKEN_LIST) + serde_json_core::from_str::(TOKEN_LIST) .map(|(t, _)| t) - .unwrap(); - // .map_err(|_| ParserError::InvalidTokenList)?; - Ok(t) + .map_err(|_| ParserError::InvalidTokenList) } impl<'a> TokenList<'a> { diff --git a/tests_zemu/snapshots/sp-mainmenu/00002.png b/tests_zemu/snapshots/sp-mainmenu/00002.png index d8b013c21ee81319faaab91c58273ad9a26226d5..4c78b4df7999e914637c1b12f3e2fcc41174ea0c 100644 GIT binary patch delta 351 zcmbQp{EKOVO1-0}i(^Q|oVPb)#hMfZ+7e%F5&pJc<=Z7zcfR&Ol{&T!-*>L+3EXG6 z#fXgo4nBme7j&Ild`u!cce>TWkbOBPuPN-&l`Gw4ZMkIq`Hn@gCme1obDXq#zHZf2 zliiCS@_q{mc zSd3rpc6PlfB*kms9#kaNEBspeZ05>~^EsEYm6Y##Q?hcI&sN5wdAi2u*ZYZH_34lM z=k;6fguct$@I9-$3m&dGBT#SJ)gOGdCHCLs*%hAg2UAZ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