Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix swap appFlags #198

Merged
merged 3 commits into from
Aug 18, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script
include $(BOLOS_SDK)/Makefile.defines

DEFINES += HAVE_SWAP
HAVE_SWAP = 1

DEFINES += APP_SECRET_MODE_ENABLED

Expand Down Expand Up @@ -79,7 +80,7 @@ endif

APP_LOAD_PARAMS = --curve ed25519 $(COMMON_LOAD_PARAMS) --path $(APPPATH)

NANOS_STACK_SIZE := 3160
NANOS_STACK_SIZE := 3136

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices

Expand Down
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=24
# This is the `spec_version` field of `Runtime`
APPVERSION_N=9430
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=2
2 changes: 1 addition & 1 deletion deps/nanox-secure-sdk
2 changes: 1 addition & 1 deletion deps/stax-secure-sdk
Submodule stax-secure-sdk updated 1342 files
2 changes: 1 addition & 1 deletion tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@zondax/ledger-substrate": "^0.41.1",
"@zondax/zemu": "^0.43.1"
"@zondax/zemu": "^0.44.0"
},
"devDependencies": {
"@types/jest": "^29.5.0",
Expand Down
Binary file modified tests_zemu/snapshots/s-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/00010.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/00010.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/st-balances_transfer/00000.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/st-balances_transfer/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/st-balances_transfer/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/st-balances_transfer/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/st-balances_transfer/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/st-balances_transfer_expert/00000.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/st-balances_transfer_expert/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/st-balances_transfer_expert/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/st-balances_transfer_expert/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/st-balances_transfer_expert/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/st-balances_transfer_expert/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/st-balances_transfer_expert/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/st-mainmenu/00000.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/st-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/st-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/st-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/st-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/st-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/st-proxy_proxy/00000.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/st-proxy_proxy/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/st-proxy_proxy/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/st-proxy_proxy/00003.png
Binary file modified tests_zemu/snapshots/st-proxy_proxy/00004.png
Binary file modified tests_zemu/snapshots/st-proxy_proxy/00005.png
Binary file modified tests_zemu/snapshots/st-raw_sign/00000.png
Binary file modified tests_zemu/snapshots/st-raw_sign/00001.png
Binary file modified tests_zemu/snapshots/st-raw_sign/00002.png
Binary file modified tests_zemu/snapshots/st-raw_sign/00003.png
Binary file modified tests_zemu/snapshots/st-raw_sign_hex/00000.png
Binary file modified tests_zemu/snapshots/st-raw_sign_hex/00001.png
Binary file modified tests_zemu/snapshots/st-raw_sign_hex/00002.png
Binary file modified tests_zemu/snapshots/st-raw_sign_hex/00003.png
Binary file modified tests_zemu/snapshots/st-raw_sign_hex/00004.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00000.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00001.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00002.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00003.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00004.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00005.png
Binary file modified tests_zemu/snapshots/st-session_setkeys/00006.png
Binary file modified tests_zemu/snapshots/st-show_address/00000.png
Binary file modified tests_zemu/snapshots/st-show_address/00001.png
Binary file modified tests_zemu/snapshots/st-show_address/00002.png
Binary file modified tests_zemu/snapshots/st-show_address_reject/00000.png
Binary file modified tests_zemu/snapshots/st-show_address_reject/00001.png
Binary file modified tests_zemu/snapshots/st-show_address_reject/00002.png
Binary file modified tests_zemu/snapshots/st-show_address_reject/00003.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00000.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00001.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00002.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00003.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00004.png
Binary file modified tests_zemu/snapshots/st-staking_nominate/00005.png
Binary file modified tests_zemu/snapshots/st-txUtility_batch/00000.png
Binary file modified tests_zemu/snapshots/st-txUtility_batch/00001.png
Binary file modified tests_zemu/snapshots/st-txUtility_batch/00002.png
Binary file modified tests_zemu/snapshots/st-txUtility_batch/00003.png
Binary file modified tests_zemu/snapshots/st-txUtility_batch/00004.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00010.png
52 changes: 0 additions & 52 deletions tests_zemu/tests/sr25519.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,56 +192,4 @@ describe('SR25519', function () {
await sim.close()
}
})

test.concurrent('sign basic expert - accept shortcut', async function () {
const sim = new Zemu(APP_PATH)
try {
await sim.start({ ...defaultOptions })
const app = newPolkadotApp(sim.getTransport())
const pathAccount = 0x80000000
const pathChange = 0x80000000
const pathIndex = 0x80000000

// Change to expert mode so we can skip fields
await sim.clickRight()
await sim.clickBoth()
await sim.clickLeft()

const txBlob = Buffer.from(txBalances_transfer, 'hex')

const responseAddr = await app.getAddress(pathAccount, pathChange, pathIndex, false, 1)
const pubKey = Buffer.from(responseAddr.pubKey, 'hex')

// do not wait here.. we need to navigate
const signatureRequest = app.sign(pathAccount, pathChange, pathIndex, txBlob, 1)

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

// Shortcut to accept menu
await sim.clickBoth()

// Accept tx
await sim.clickBoth()

const signatureResponse = await signatureRequest
console.log(signatureResponse)

expect(signatureResponse.return_code).toEqual(0x9000)
expect(signatureResponse.error_message).toEqual('No errors')

// Now verify the signature
let prehash = txBlob
if (txBlob.length > 256) {
const context = blake2bInit(32)
blake2bUpdate(context, txBlob)
prehash = Buffer.from(blake2bFinal(context))
}
const signingcontext = Buffer.from([])
const valid = addon.schnorrkel_verify(pubKey, signingcontext, prehash, signatureResponse.signature.subarray(1))
expect(valid).toEqual(true)
} finally {
await sim.close()
}
})
})
Loading