Skip to content

Commit

Permalink
Merge pull request #18 from Zondax/bls_ui_fixes
Browse files Browse the repository at this point in the history
Official Screen on Clear Sign Warning
  • Loading branch information
0xPxt authored Jan 14, 2025
2 parents ee90d5e + 4e35252 commit 7dce266
Show file tree
Hide file tree
Showing 41 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=1
# This is the minor version
APPVERSION_N=0
# This is the patch version
APPVERSION_P=4
APPVERSION_P=5
2 changes: 1 addition & 1 deletion deps/ledger-zxlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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-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/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 modified 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 modified 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/s-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/s-mainmenu/00009.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/00009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/st-mainmenu/00001.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00002.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00003.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00005.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00009.png
47 changes: 46 additions & 1 deletion tests_zemu/tests/transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
******************************************************************************* */

import Zemu, {ButtonKind, isTouchDevice, TouchNavigation} from '@zondax/zemu'
import Zemu, {ButtonKind, isTouchDevice, TouchNavigation, zondaxMainmenuNavigation} from '@zondax/zemu'
import { KadenaApp, TransferTxType, TransferCrossChainTxParams } from '@zondax/ledger-kadena'
import { PATH, defaultOptions, models } from './common'
import { blake2bFinal, blake2bInit, blake2bUpdate } from 'blakejs'
Expand Down Expand Up @@ -100,6 +100,51 @@ describe.each(HASH_TEST_CASES)('Hash transactions', function (data) {
})
})

describe.each(HASH_TEST_CASES)('Hash transactions BLS off', function (data) {
test.concurrent.each(models)('clear sign hash', async function (m) {
if (!isTouchDevice(m.name)) {
return
}
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
const app = new KadenaApp(sim.getTransport())

const responseAddr = await app.getAddressAndPubKey(data.path)
const pubKey = responseAddr.pubkey

const req = app.signHash(data.path, data.hash).catch(error => {
// Store the error to verify later, we are expecting signHash to fail
return error;
});

// Wait until we are not in the main menu
await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot())

// Confirm "Go to settings" and toggle Blind Signing
const nav = new TouchNavigation(m.name, [
ButtonKind.ConfirmYesButton,
ButtonKind.ToggleSettingButton2,
ButtonKind.SettingsNavRightButton,
ButtonKind.SettingsNavRightButton,
ButtonKind.SettingsQuitButton,
]);
await sim.navigateAndCompareSnapshots('.', `${m.prefix.toLowerCase()}-clear_sign_${data.name}`, nav.schedule)

const result = await req;

// Verify the error, anything other than 0x6984 is not expected
expect(result).toMatchObject({
returnCode: 0x6984,
message: expect.stringContaining("Data is invalid")
});

} finally {
await sim.close()
}
})
})

describe.each(TRANSACTIONS_TEST_CASES)('Tx transfer', function (data) {
test.concurrent.each(models)('sign transfer tx', async function (m) {
const sim = new Zemu(m.path)
Expand Down

0 comments on commit 7dce266

Please sign in to comment.