Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala committed Oct 26, 2023
1 parent 650fcf1 commit 76a769a
Show file tree
Hide file tree
Showing 117 changed files with 82,373 additions and 78,274 deletions.
78,993 changes: 40,067 additions & 38,926 deletions tests/testcases_current.json

Large diffs are not rendered by default.

81,571 changes: 42,291 additions & 39,280 deletions tests/testcases_previous.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@
"test": "yarn clean && jest --maxConcurrency 3"
},
"dependencies": {
"@zondax/ledger-substrate": "^0.41.1",
"@zondax/zemu": "^0.43.1"
"@zondax/ledger-substrate": "^0.41.3",
"@zondax/zemu": "^0.44.2"
},
"devDependencies": {
"@types/jest": "^29.2.1",
"@types/ledgerhq__hw-transport": "^4.21.4",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"blakejs": "^1.1.1",
"crypto-js": "4.1.1",
"crypto-js": "4.2.0",
"ed25519-supercop": "^2.0.1",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.5.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "29.7.0",
"jssha": "^3.2.0",
"prettier": "^2.4.1",
"prettier": "^3.0.3",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.4.3"
"typescript": "^5.2.2"
}
}
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/s-session_setkeys/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/s-session_setkeys/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/s-session_setkeys/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/s-session_setkeys/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-session_setkeys/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-session_setkeys/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/s-session_setkeys/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/s-session_setkeys/00008.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-session_setkeys/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/s-session_setkeys/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/s-session_setkeys/00011.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-session_setkeys/00012.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-session_setkeys/00013.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-session_setkeys/00014.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-session_setkeys/00015.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-session_setkeys/00016.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-session_setkeys/00017.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/s-session_setkeys/00018.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/s-session_setkeys/00019.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/sp-session_setkeys/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-session_setkeys/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-session_setkeys/00004.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00005.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00006.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00007.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00008.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00009.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00010.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00011.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00012.png
Binary file modified tests_zemu/snapshots/sp-session_setkeys/00013.png
Binary file added tests_zemu/snapshots/sp-session_setkeys/00014.png
Binary file added tests_zemu/snapshots/sp-session_setkeys/00015.png
Binary file modified tests_zemu/snapshots/st-balances_transfer/00000.png
Binary file modified tests_zemu/snapshots/st-balances_transfer/00001.png
Binary file modified tests_zemu/snapshots/st-balances_transfer/00002.png
Binary file modified tests_zemu/snapshots/st-balances_transfer/00003.png
Binary file modified tests_zemu/snapshots/st-balances_transfer/00004.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00000.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00001.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00002.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00003.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00004.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00005.png
Binary file modified tests_zemu/snapshots/st-balances_transfer_expert/00006.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00000.png
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/st-mainmenu/00005.png
Binary file modified tests_zemu/snapshots/st-proxy_proxy/00000.png
Binary file modified tests_zemu/snapshots/st-proxy_proxy/00001.png
Binary file modified tests_zemu/snapshots/st-proxy_proxy/00002.png
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 added tests_zemu/snapshots/st-session_setkeys/00007.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
Binary file modified tests_zemu/snapshots/x-session_setkeys/00002.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00003.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00004.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00005.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00006.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00007.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00008.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00009.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00010.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00011.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00012.png
Binary file modified tests_zemu/snapshots/x-session_setkeys/00013.png
Binary file added tests_zemu/snapshots/x-session_setkeys/00014.png
Binary file added tests_zemu/snapshots/x-session_setkeys/00015.png
53 changes: 0 additions & 53 deletions tests_zemu/tests/sr25519.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,57 +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 = newKusamaApp(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()
}
})

})
10 changes: 5 additions & 5 deletions tests_zemu/tests/zemu_blobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
******************************************************************************* */

export const txBalances_transfer =
'040700313233343536373839303132333435363738393031323334353637383930313233158139ae28a3dfaac5fe1560a5e9e05cd5038d2433158139ae28a3dfaac5fe1560a5e9e05cd624000017000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'
'040700313233343536373839303132333435363738393031323334353637383930313233158139ae28a3dfaac5fe1560a5e9e05cd5038d2433158139ae28a3dfaac5fe1560a5e9e05c40420f0018000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'

export const txStaking_nominate =
'060510003132333435363738393031323334353637383930313233343536373839303132003132333435363738393031323334353637383930313233343536373839303133003132333435363738393031323334353637383930313233343536373839303134003132333435363738393031323334353637383930313233343536373839303135d5038d2433158139ae28a3dfaac5fe1560a5e9e05cd624000017000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'
'060510003132333435363738393031323334353637383930313233343536373839303132003132333435363738393031323334353637383930313233343536373839303133003132333435363738393031323334353637383930313233343536373839303134003132333435363738393031323334353637383930313233343536373839303135d5038d2433158139ae28a3dfaac5fe1560a5e9e05c40420f0018000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'

export const txSession_setKeys =
'080031323334353637383930313233343536373839303132333435363738393031323132333435363738393031323334353637383930313233343536373839303132313233343536373839303132333435363738393031323334353637383930313231323334353637383930313233343536373839303132333435363738393031320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d5038d2433158139ae28a3dfaac5fe1560a5e9e05cd624000017000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'
'080031323334353637383930313233343536373839303132333435363738393031323132333435363738393031323334353637383930313233343536373839303132313233343536373839303132333435363738393031323334353637383930313231323334353637383930313233343536373839303132333435363738393031320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d5038d2433158139ae28a3dfaac5fe1560a5e9e05c40420f0018000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'

export const txUtility_batch =
'18000800000834340000083838d5038d2433158139ae28a3dfaac5fe1560a5e9e05cd624000017000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'
'18000800000834340000083838d5038d2433158139ae28a3dfaac5fe1560a5e9e05c40420f0018000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'

export const txProxy_proxy =
'1e000031323334353637383930313233343536373839303132333435363738393031320100040000313233343536373839303132333435363738393031323334353637383930313233158139ae28a3dfaac5fe1560a5e9e05cd5038d2433158139ae28a3dfaac5fe1560a5e9e05cd624000017000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'
'1e000031323334353637383930313233343536373839303132333435363738393031320100040000313233343536373839303132333435363738393031323334353637383930313233158139ae28a3dfaac5fe1560a5e9e05cd5038d2433158139ae28a3dfaac5fe1560a5e9e05c40420f0018000000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafeb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe'

0 comments on commit 76a769a

Please sign in to comment.