diff --git a/app/Makefile.version b/app/Makefile.version index 02cf60bc..8b54b0ef 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=35 # This is the patch version of this release -APPVERSION_P=12 +APPVERSION_P=13 diff --git a/app/src/chain_config.c b/app/src/chain_config.c index 1fd848a7..8ffac9cf 100644 --- a/app/src/chain_config.c +++ b/app/src/chain_config.c @@ -26,6 +26,7 @@ typedef struct { static const chain_config_t chainConfig[] = { // {118, cosmos, BECH32_COSMOS}, {60, "inj", BECH32_ETH}, + {60, "evmos", BECH32_ETH} }; static const uint32_t chainConfigLen = sizeof(chainConfig) / sizeof(chainConfig[0]); diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index ba1bdc35..7ff378c8 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index ba1bdc35..7ff378c8 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index 33c0445e..cfc9da13 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index 33c0445e..cfc9da13 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index 63b62b71..f9c99325 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 33c0445e..cfc9da13 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index 33c0445e..cfc9da13 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ diff --git a/tests_zemu/tests/textual.test.ts b/tests_zemu/tests/textual.test.ts index a62ee084..96532027 100644 --- a/tests_zemu/tests/textual.test.ts +++ b/tests_zemu/tests/textual.test.ts @@ -226,4 +226,59 @@ describe('Textual', function () { await sim.close() } }) + + test.concurrent.each(DEVICE_MODELS)('sign basic textual evmos ', async function (m) { + const sim = new Zemu(m.path) + try { + await sim.start({ ...defaultOptions, model: m.name }) + const app = new CosmosApp(sim.getTransport()) + + // Enable expert to allow sign with eth path + await sim.toggleExpertMode() + + const path = [44, 60, 0, 0, 0] + const tx = Buffer.from(tx_sign_textual, 'hex') + const hrp = 'evmos' + + // get address / publickey + const respPk = await app.getAddressAndPubKey(path, hrp) + expect(respPk.return_code).toEqual(0x9000) + expect(respPk.error_message).toEqual('No errors') + console.log(respPk) + + // do not wait here.. + const signatureRequest = app.sign(path, tx, hrp, TEXTUAL_TX) + + // Wait until we are not in the main menu + await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) + const last_index = await sim.navigateUntilText( + '.', + `${m.prefix.toLowerCase()}-textual-sign_basic_evmos`, + sim.startOptions.approveKeyword, + false, + false, + ) + + const resp = await signatureRequest + console.log(resp) + + expect(resp.return_code).toEqual(0x9000) + expect(resp.error_message).toEqual('No errors') + expect(resp).toHaveProperty('signature') + + // Now verify the signature + const sha3 = require('js-sha3') + const msgHash = Buffer.from(sha3.keccak256(tx), 'hex') + + const signatureDER = resp.signature + const signature = secp256k1.signatureImport(Uint8Array.from(signatureDER)) + + const pk = Uint8Array.from(respPk.compressed_pk) + + const signatureOk = secp256k1.ecdsaVerify(signature, msgHash, pk) + expect(signatureOk).toEqual(true) + } finally { + await sim.close() + } + }) })