Skip to content

Commit

Permalink
Merge pull request #96 from Zondax/dev
Browse files Browse the repository at this point in the history
New Release
  • Loading branch information
emmanuelm41 authored Nov 19, 2024
2 parents bc24550 + 50ee4e1 commit 3485a6a
Show file tree
Hide file tree
Showing 80 changed files with 49 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[env]
HEAP_SIZE = "16384"
APPVERSION = "1.0.0"
APPVERSION = "1.1.0"

[unstable]
build-std = ["core", "alloc"]
Expand Down
2 changes: 1 addition & 1 deletion app/src/app_ui/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn ui_menu_main(comm: &mut Comm) -> Event<Instruction> {
false => "Disabled",
};

app_version = String::from("x");
// app_version = String::from("x");
let pages = [
&Page::from((_first_page_label, &APP_ICON)),
&Page::from((["Expert Mode", expert_mode_label], true, true)),
Expand Down
8 changes: 2 additions & 6 deletions app/src/app_ui/run_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ pub fn ui_review_transaction<'a>(

#[cfg(not(any(target_os = "stax", target_os = "flex")))]
{
let field_pairs = transaction
.review_fields(ovk)
.map_err(|_| AppSW::BufferOutOfBounds)?;
let field_pairs = transaction.review_fields(ovk)?;

// Create a vector to hold the Field structs
let fields: Vec<Field> = field_pairs
Expand Down Expand Up @@ -77,9 +75,7 @@ pub fn ui_review_transaction<'a>(
#[cfg(target_os = "flex")]
const FERRIS: NbglGlyph = NbglGlyph::from_include(include_gif!("flex_icon.gif", NBGL));

let field_pairs = transaction
.review_fields(ovk)
.map_err(|_| AppSW::BufferOutOfBounds)?;
let field_pairs = transaction.review_fields(ovk)?;

// Create a vector to hold the Field structs
let fields: Vec<Field> = field_pairs
Expand Down
1 change: 1 addition & 0 deletions app/src/ironfish/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ pub enum IronfishError {
RandomnessError,
RoundTwoSigningFailure,
TryFromInt,
ErrExpertModeMustBeEnabled,
Utf8,
}
1 change: 1 addition & 0 deletions app/src/parser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub enum ParserError {
BufferFull,
InvalidTokenList,
UnknownToken,
ErrExpertModeMustBeEnabled,

UnexpectedError,
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/parser/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl Note {

#[cfg(feature = "ledger")]
if !Settings.app_expert_mode() {
return Err(ParserError::UnknownToken);
return Err(ParserError::ErrExpertModeMustBeEnabled);
}

let amount_label = String::from("Raw Amount ");
Expand Down
6 changes: 4 additions & 2 deletions app/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ pub enum AppSW {
WrongP1P2 = 0x6A86,
InsNotSupported = 0x6D00,
ClaNotSupported = 0x6E00,
TxDisplayFail = 0xB001,
AddrDisplayFail = 0xB002,
TxWrongLength = 0xB004,
TxParsingFail = 0xB005,
TxHashFail = 0xB006,
TxSignFail = 0xB008,
KeyDeriveFail = 0xB009,
VersionParsingFail = 0xB00A,
Expand All @@ -43,6 +41,7 @@ pub enum AppSW {
TooManyParticipants = 0xB024,
InvalidTxHash = 0xB025,
InvalidToken = 0xB026,
ErrExpertModeMustBeEnabled = 0xB027,
#[cfg(feature = "ledger")]
WrongApduLength = StatusWords::BadLen as u16,
Ok = 0x9000,
Expand All @@ -61,6 +60,7 @@ impl From<IronfishError> for AppSW {
IronfishError::RoundTwoSigningFailure => AppSW::DkgRound2Fail,
IronfishError::InvalidSigningKey => AppSW::KeyDeriveFail,
IronfishError::InvalidSecret => AppSW::InvalidGroupSecretKey,
IronfishError::ErrExpertModeMustBeEnabled => AppSW::ErrExpertModeMustBeEnabled,
// For errors that don't have a direct mapping, use a generic error
_ => AppSW::Deny,
}
Expand Down Expand Up @@ -89,6 +89,7 @@ impl From<ParserError> for AppSW {
ParserError::BufferFull => AppSW::BufferOutOfBounds,
ParserError::InvalidTokenList => AppSW::InvalidPublicPackage,
ParserError::UnknownToken => AppSW::InvalidToken,
ParserError::ErrExpertModeMustBeEnabled => AppSW::ErrExpertModeMustBeEnabled,
}
}
}
Expand Down Expand Up @@ -133,6 +134,7 @@ impl From<ParserError> for IronfishError {
ParserError::InvalidTokenList => IronfishError::InvalidAssetIdentifier,
ParserError::UnexpectedError => IronfishError::InvalidData,
ParserError::UnknownToken => IronfishError::InvalidData,
ParserError::ErrExpertModeMustBeEnabled => IronfishError::ErrExpertModeMustBeEnabled,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion js
Submodule js updated 3 files
+1 −1 package.json
+64 −0 src/consts.ts
+20 −19 src/index.ts
Binary file modified tests_zemu/snapshots/fl-mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p2-m2-0-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p2-m2-1-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p3-m2-0-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p3-m2-1-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p3-m2-2-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p4-m2-0-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p4-m2-1-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p4-m2-2-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-dkg-p4-m2-3-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-review-transaction/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-review-transaction/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-review-transaction/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-tmp-review-transaction/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p2-m2-0-backup/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p2-m2-0-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p2-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p2-m2-1-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-0-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-0-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-1-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-2-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p3-m2-2-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-0-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-0-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-1-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-2-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-2-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-3-backup/00001.png
Binary file modified tests_zemu/snapshots/sp-tmp-dkg-p4-m2-3-backup/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00002.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00003.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00004.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00005.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00007.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00008.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00010.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00011.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00012.png
Binary file modified tests_zemu/snapshots/sp-tmp-review-transaction/00013.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00000.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00001.png
Binary file added tests_zemu/snapshots/st-mainmenu/00002.png
Binary file added tests_zemu/snapshots/st-mainmenu/00003.png
Binary file added tests_zemu/snapshots/st-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p2-m2-0-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p2-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p3-m2-0-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p3-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p3-m2-2-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p4-m2-0-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p4-m2-1-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p4-m2-2-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-dkg-p4-m2-3-backup/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-review-transaction/00001.png
Binary file modified tests_zemu/snapshots/st-tmp-review-transaction/00002.png
Binary file modified tests_zemu/snapshots/st-tmp-review-transaction/00003.png
4 changes: 2 additions & 2 deletions tests_zemu/tests/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Basic', function () {
})

// TODO fix ST and FL main menu
test.skip.each(models)('main menu', async function (m) {
test.each(models.filter(v => v.name === 'nanosp'))('main menu', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name, startText: startTextFn(m.name) })
Expand All @@ -58,7 +58,7 @@ describe('Basic', function () {

expect(resp.testMode).toBe(false)
expect(resp.major).toBe(1)
expect(resp.minor).toBe(0)
expect(resp.minor).toBe(1)
expect(resp.patch).toBe(0)
} finally {
await sim.close()
Expand Down
5 changes: 3 additions & 2 deletions tests_zemu/tests/failures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,14 @@ describe.each(models)('wrong actions', function (m) {
} catch (error) {
// Convert unknown error to string for comparison
const errorStr = String(error)
if (errorStr.includes('Unknown Return Code: 0xB010') || errorStr.includes('Timeout waiting for screen')) {
console.log('ErrorStr ', errorStr)
if (errorStr.includes('Expert mode is required')) {
throw new Error(errorStr)
}
throw error
}
}),
).rejects.toThrow(/Unknown Return Code: 0xB010|Timeout waiting for screen/)
).rejects.toThrow(/Expert mode is required/)
}
} finally {
for (let i = 0; i < globalSims.length; i++) await globalSims[i].close()
Expand Down
39 changes: 32 additions & 7 deletions tests_zemu/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,26 @@
rxjs "^7.8.1"
semver "^7.3.5"

"@ledgerhq/devices@^8.4.4":
version "8.4.4"
resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.4.4.tgz#0d195c1650fe57da2fad7f0d9074a0190947cd6f"
integrity sha512-sz/ryhe/R687RHtevIE9RlKaV8kkKykUV4k29e7GAVwzHX1gqG+O75cu1NCJUHLbp3eABV5FdvZejqRUlLis9A==
dependencies:
"@ledgerhq/errors" "^6.19.1"
"@ledgerhq/logs" "^6.12.0"
rxjs "^7.8.1"
semver "^7.3.5"

"@ledgerhq/errors@^6.18.0":
version "6.18.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.18.0.tgz#d55d6a57430d7a86532a9033ce0b45103264c620"
integrity sha512-L3jQWAGyooxRDk/MRlW2v4Ji9+kloBtdmz9wBkHaj2j0n+05rweJSV3GHw9oye1BYMbVFqFffmT4H3hlXlCasw==

"@ledgerhq/errors@^6.19.1":
version "6.19.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.19.1.tgz#d9ac45ad4ff839e468b8f63766e665537aaede58"
integrity sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw==

"@ledgerhq/hw-transport-http@^6.30.1":
version "6.30.2"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.30.2.tgz#2b520641f10b1161e2afcda60a8e7d575b62f331"
Expand Down Expand Up @@ -884,7 +899,17 @@
node-hid "2.1.2"
usb "2.9.0"

"@ledgerhq/[email protected]", "@ledgerhq/hw-transport@^6.31.2":
"@ledgerhq/[email protected]":
version "6.31.4"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.31.4.tgz#9b23a6de4a4caaa5c24b149c2dea8adde46f0eb1"
integrity sha512-6c1ir/cXWJm5dCWdq55NPgCJ3UuKuuxRvf//Xs36Bq9BwkV2YaRQhZITAkads83l07NAdR16hkTWqqpwFMaI6A==
dependencies:
"@ledgerhq/devices" "^8.4.4"
"@ledgerhq/errors" "^6.19.1"
"@ledgerhq/logs" "^6.12.0"
events "^3.3.0"

"@ledgerhq/hw-transport@^6.31.2":
version "6.31.2"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.31.2.tgz#79c95f7928a64a0e3b5bc4ea7b5be04b9f738322"
integrity sha512-B27UIzMzm2IXPGYnEB95R7eHxpXBkTBHh6MUJJQZVknt8LilEz1tfpTYUdzAKDGQ+Z5MZyYb01Eh3Zqm3kn3uw==
Expand Down Expand Up @@ -1446,14 +1471,14 @@
"@zondax/ledger-ironfish@../js":
version "0.0.0"
dependencies:
"@zondax/ledger-js" "^1.0.1"
"@zondax/ledger-js" "^1.2.0"

"@zondax/ledger-js@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@zondax/ledger-js/-/ledger-js-1.0.1.tgz#a1c51943c5b7d1370cea588b193197234485d196"
integrity sha512-9h+aIXyEK+Rdic5Ppsmq+tptDFwPTacG1H6tpZHFdhtBFHYFOLLkKTTmq5rMTv84aAPS1v0tnsF1e2Il6M05Cg==
"@zondax/ledger-js@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@zondax/ledger-js/-/ledger-js-1.2.0.tgz#13fb6b4ac1b395f39d05d1efb23dfe97d6011463"
integrity sha512-HGvDU0s4zg0scu8ebGenFHFB6g5SLDqmrctncZUY9ie5pGibOU8C0VdjZSHbttSOCyh+IloLi/a4jyMPOEQGuQ==
dependencies:
"@ledgerhq/hw-transport" "6.31.2"
"@ledgerhq/hw-transport" "6.31.4"

"@zondax/zemu@^0.50.2":
version "0.50.2"
Expand Down

0 comments on commit 3485a6a

Please sign in to comment.