From 4ce1033712e4ac46253e55b7b20bd8039306d9f0 Mon Sep 17 00:00:00 2001 From: ftheirs Date: Wed, 22 Nov 2023 17:37:06 -0300 Subject: [PATCH] support for Stax --- .gitmodules | 3 + Makefile | 3 +- app/src/common/tx.c | 4 +- app/src/crypto_helper.c | 12 +-- deps/ledger-secure-sdk | 1 + tests_zemu/tests/common.ts | 8 +- tests_zemu/tests/standard.test.ts | 20 +++-- tests_zemu/tests/transactions.test.ts | 116 +++++++++++++------------- 8 files changed, 91 insertions(+), 76 deletions(-) create mode 160000 deps/ledger-secure-sdk diff --git a/.gitmodules b/.gitmodules index 8cf89988..22b3c267 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "deps/nanos-secure-sdk"] path = deps/nanos-secure-sdk url = https://github.com/LedgerHQ/nanos-secure-sdk +[submodule "deps/ledger-secure-sdk"] + path = deps/ledger-secure-sdk + url = https://github.com/LedgerHQ/ledger-secure-sdk diff --git a/Makefile b/Makefile index afd318f9..320d7315 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,7 @@ TESTS_JS_DIR = $(CURDIR)/js ifeq ($(BOLOS_SDK),) # In this case, there is not predefined SDK and we run dockerized # When not using the SDK, we override and build the XL complete app - -SUBSTRATE_PARSER_FULL ?= 1 +ZXLIB_COMPILE_STAX ?= 1 include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk else diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 35d4700d..fa5809da 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -21,7 +21,7 @@ #include #include "zxmacros.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) #define RAM_BUFFER_SIZE 8192 #define FLASH_BUFFER_SIZE 16384 #elif defined(TARGET_NANOS) @@ -37,7 +37,7 @@ typedef struct { uint8_t buffer[FLASH_BUFFER_SIZE]; } storage_t; -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) storage_t NV_CONST N_appdata_impl __attribute__((aligned(64))); #define N_appdata (*(NV_VOLATILE storage_t *)PIC(&N_appdata_impl)) #endif diff --git a/app/src/crypto_helper.c b/app/src/crypto_helper.c index cc4776c8..370e948c 100644 --- a/app/src/crypto_helper.c +++ b/app/src/crypto_helper.c @@ -23,7 +23,7 @@ #include "bolos_target.h" #endif -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) #include "cx.h" #include "cx_sha256.h" #else @@ -47,7 +47,7 @@ static zxerr_t crypto_publicKeyHash_ed25519(uint8_t *publicKeyHash, const uint8_ // Step 2. Hash the serialized public key with sha256. uint8_t pkh[CX_SHA256_SIZE] = {0}; -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) cx_hash_sha256((const uint8_t*) borshEncodedPubKey, PK_LEN_25519 + 1, pkh, CX_SHA256_SIZE); #else picohash_ctx_t ctx; @@ -111,7 +111,7 @@ zxerr_t crypto_sha256(const uint8_t *input, uint16_t inputLen, uint8_t *output, MEMZERO(output, outputLen); -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) cx_hash_sha256(input, inputLen, output, CX_SHA256_SIZE); #else picohash_ctx_t ctx; @@ -127,7 +127,7 @@ zxerr_t crypto_hashExtraDataSection(const section_t *extraData, uint8_t *output, return zxerr_invalid_crypto_settings; } -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) cx_sha256_t sha256 = {0}; cx_sha256_init(&sha256); cx_sha256_update(&sha256, &extraData->discriminant, 1); @@ -159,7 +159,7 @@ zxerr_t crypto_hashDataSection(const section_t *data, uint8_t *output, uint32_t return zxerr_no_data; } -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) cx_sha256_t sha256 = {0}; cx_sha256_init(&sha256); cx_sha256_update(&sha256, &data->discriminant, 1); @@ -185,7 +185,7 @@ zxerr_t crypto_hashCodeSection(const section_t *code, uint8_t *output, uint32_t return zxerr_invalid_crypto_settings; } -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) cx_sha256_t sha256 = {0}; cx_sha256_init(&sha256); cx_sha256_update(&sha256, &code->discriminant, 1); diff --git a/deps/ledger-secure-sdk b/deps/ledger-secure-sdk new file mode 160000 index 00000000..e050ce5a --- /dev/null +++ b/deps/ledger-secure-sdk @@ -0,0 +1 @@ +Subproject commit e050ce5af3e9ac490fce6c9aebc95ee2d20aceb1 diff --git a/tests_zemu/tests/common.ts b/tests_zemu/tests/common.ts index ccae4897..4fe766a7 100644 --- a/tests_zemu/tests/common.ts +++ b/tests_zemu/tests/common.ts @@ -7,11 +7,13 @@ export const APP_SEED = 'equip will roof matter pink blind book anxiety banner e const APP_PATH_S = Resolve('../app/output/app_s.elf') const APP_PATH_X = Resolve('../app/output/app_x.elf') const APP_PATH_SP = Resolve('../app/output/app_s2.elf') +const APP_PATH_ST = Resolve('../app/output/app_stax.elf') export const models: IDeviceModel[] = [ - { name: 'nanos', prefix: 'S', path: APP_PATH_S }, - { name: 'nanox', prefix: 'X', path: APP_PATH_X }, - { name: 'nanosp', prefix: 'SP', path: APP_PATH_SP }, + // { name: 'nanos', prefix: 'S', path: APP_PATH_S }, + // { name: 'nanox', prefix: 'X', path: APP_PATH_X }, + // { name: 'nanosp', prefix: 'SP', path: APP_PATH_SP }, + { name: 'stax', prefix: 'ST', path: APP_PATH_ST }, ] export const hdpath = `m/44'/877'/0'/0'/0'` diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index 6461089d..e7fcac87 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************* */ -import Zemu from '@zondax/zemu' +import Zemu, { ButtonKind, zondaxMainmenuNavigation } from '@zondax/zemu' import { NamadaApp } from '@zondax/ledger-namada' import { models, hdpath, defaultOptions } from './common' @@ -36,8 +36,9 @@ describe('Standard', function () { test.concurrent.each(models)('main menu', async function (m) { const sim = new Zemu(m.path) try { + const mainmenuNavigation = zondaxMainmenuNavigation(m.name) await sim.start({ ...defaultOptions, model: m.name }) - await sim.navigateAndCompareSnapshots('.', `${m.prefix.toLowerCase()}-mainmenu`, [1, 0, 0, 4, -5]) + await sim.navigateAndCompareSnapshots('.', `${m.prefix.toLowerCase()}-mainmenu`, mainmenuNavigation.schedule) } finally { await sim.close() } @@ -91,7 +92,12 @@ describe('Standard', function () { test.concurrent.each(models)('show address', async function (m) { const sim = new Zemu(m.path) try { - await sim.start({ ...defaultOptions, model: m.name }) + await sim.start({ + ...defaultOptions, + model: m.name, + approveKeyword: m.name === 'stax' ? 'QR' : '', + approveAction: ButtonKind.ApproveTapButton, + }) const app = new NamadaApp(sim.getTransport()) const respRequest = app.showAddressAndPubKey(hdpath) @@ -120,13 +126,17 @@ describe('Standard', function () { test.concurrent.each(models)('show address - reject', async function (m) { const sim = new Zemu(m.path) try { - await sim.start({ ...defaultOptions, model: m.name }) + await sim.start({ + ...defaultOptions, + model: m.name, + rejectKeyword: m.name === 'stax' ? 'QR' : '', + }) const app = new NamadaApp(sim.getTransport()) const respRequest = app.showAddressAndPubKey(hdpath) await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - await sim.navigateAndCompareUntilText('.', `${m.prefix.toLowerCase()}-show_address_reject`, 'REJECT') + await sim.compareSnapshotsAndReject('.', `${m.prefix.toLowerCase()}-show_address_reject`) const resp = await respRequest console.log(resp) diff --git a/tests_zemu/tests/transactions.test.ts b/tests_zemu/tests/transactions.test.ts index aa9de01f..0b26b633 100644 --- a/tests_zemu/tests/transactions.test.ts +++ b/tests_zemu/tests/transactions.test.ts @@ -61,27 +61,27 @@ function hashSignatureSec(pubkeys: Buffer[], salt: Buffer, hashes: { [index: num } const TEST_DATA = [ - { - name: 'bond', - blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000200000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb3', 'hex'), - sectionHashes: { - 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), - 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), - 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), - 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), - } as { [index: number]: Buffer }, - }, - { - name: 'init_proposal', - blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a32382e3130313832393531382b30303a3030036244dbf2c2d2fc6900e7c46a0d81e75a6e137c4900ee614cc8b1551543ce5d9e467e3e8db73280a50aac95b59e54ece4f670624e1a46388dd0c458e78076420101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75170500000000000000a86100000000000000030000000194468bd88b010000007e68fb834a7772c82a312c4e6e519d97282cce39507950c35fe89f1c347a4a2e000294468bd88b01000000d81ff4dba9b1316576360dc94fcd611f9b228b040eaefb5157819d692eb4ef50011500000074785f696e69745f70726f706f73616c2e7761736d0094468bd88b0100005000000000061a4caa2da23123adeb4ae80ba0dc5239bff64baa4aaf5f385dc6877ae22e2600282bcb6a66c770f23e7b2f068ae0ba025eccb2ec00000c0000000000000018000000000000001e00000000000000', 'hex'), - sectionHashes: { - 0: Buffer.from('e86108905c4ba210c2c20289369b9cbcad3dfed25c601b9b6673ddef5573e3d4', 'hex'), - 1: Buffer.from('061a4caa2da23123adeb4ae80ba0dc5239bff64baa4aaf5f385dc6877ae22e26', 'hex'), - 2: Buffer.from('036244dbf2c2d2fc6900e7c46a0d81e75a6e137c4900ee614cc8b1551543ce5d', 'hex'), - 3: Buffer.from('9e467e3e8db73280a50aac95b59e54ece4f670624e1a46388dd0c458e7807642', 'hex'), - 0xff: Buffer.from('039a4d90beb2ead23ef48cecc0039104f865dd3c6c89ee12b90defbe8205c319', 'hex'), - } as { [index: number]: Buffer }, - }, + // { + // name: 'bond', + // blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000200000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb3', 'hex'), + // sectionHashes: { + // 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), + // 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), + // 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), + // 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), + // } as { [index: number]: Buffer }, + // }, + // { + // name: 'init_proposal', + // blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a32382e3130313832393531382b30303a3030036244dbf2c2d2fc6900e7c46a0d81e75a6e137c4900ee614cc8b1551543ce5d9e467e3e8db73280a50aac95b59e54ece4f670624e1a46388dd0c458e78076420101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75170500000000000000a86100000000000000030000000194468bd88b010000007e68fb834a7772c82a312c4e6e519d97282cce39507950c35fe89f1c347a4a2e000294468bd88b01000000d81ff4dba9b1316576360dc94fcd611f9b228b040eaefb5157819d692eb4ef50011500000074785f696e69745f70726f706f73616c2e7761736d0094468bd88b0100005000000000061a4caa2da23123adeb4ae80ba0dc5239bff64baa4aaf5f385dc6877ae22e2600282bcb6a66c770f23e7b2f068ae0ba025eccb2ec00000c0000000000000018000000000000001e00000000000000', 'hex'), + // sectionHashes: { + // 0: Buffer.from('e86108905c4ba210c2c20289369b9cbcad3dfed25c601b9b6673ddef5573e3d4', 'hex'), + // 1: Buffer.from('061a4caa2da23123adeb4ae80ba0dc5239bff64baa4aaf5f385dc6877ae22e26', 'hex'), + // 2: Buffer.from('036244dbf2c2d2fc6900e7c46a0d81e75a6e137c4900ee614cc8b1551543ce5d', 'hex'), + // 3: Buffer.from('9e467e3e8db73280a50aac95b59e54ece4f670624e1a46388dd0c458e7807642', 'hex'), + // 0xff: Buffer.from('039a4d90beb2ead23ef48cecc0039104f865dd3c6c89ee12b90defbe8205c319', 'hex'), + // } as { [index: number]: Buffer }, + // }, { name: 'init_validator', blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33333a31302e3636383135373431372b30303a3030b22ee9c99e4872bab5ba08de9ca303e91752467dfff0f9c553e48fd59710dd25f19e162831bc6d5727ccc116dffc00e7a8a63e70c7b839a8d8c88c411bf7cc470101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d81500000000000000a8610000000000000003000000010cd78cd88b0100000053e9023f2edc55e90bdcf6024760140a91a7904cb4a529cb1707ea3d34ee685a010c00000076705f757365722e7761736d020cd78cd88b01000000aa3b3dd227cd3199b3cef164b679fc62a4e6531ffce547eadb766c050d5fabfd011600000074785f696e69745f76616c696461746f722e7761736d000cd78cd88b0100001a010000010000000048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80100b8a1bde0e03a61c147c6f1213e0951e8947c3eabc7a81940bdb9a46da2575df1034f85391fb1d43071b7e020c2709923df792661f6436f0ee88790dd5564238fdf02ea1b59f3111bac9ec7715f569299bfd384d701d405734d7a7514df86bf5e993500bfce4de74239e46afaec08bbd6157d082a21554220a1d9e3a470d7a346aa7d5a00743ba40b00000000000000000000000000000000000000000000000000000000e40b5402000000000000000000000000000000000000000000000000000000090000006d65406d652e636f6d000000832542bf65dcc5e4846a4e9e539946ce7c81f566337c25bb4adb33c0ee16dcbe', 'hex'), @@ -93,45 +93,45 @@ const TEST_DATA = [ 0xff: Buffer.from('777d23250a5436e408a1843f14477b1219bb2db05f5ec439badcfb4f6a70448b', 'hex'), } as { [index: number]: Buffer }, }, - { - name: 'update_vp', - blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33333a30352e3139313137373835302b30303a30305df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a290f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75171400000000000000a861000000000000000500000001d2c18cd88b0100000053e9023f2edc55e90bdcf6024760140a91a7904cb4a529cb1707ea3d34ee685a010c00000076705f757365722e7761736d02d3c18cd88b0100000049a9b2023b4858255845bfa3949e314f241858949214950471b0b598febd7248011600000074785f7570646174655f6163636f756e742e7761736d00d3c18cd88b0100009f00000000ba4c9645a23343896227110a902af84e7b4a4bb301a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a41703000000009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75170048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80075c251407a7ed91b8114f90b6f454db9071a290458e2db36106b99daf4bf83b101020301000000ae19fb14011c761f61ea480a4d9fffd1abb049be4715f5344d6f60093470c0800000ba4c9645a23343896227110a902af84e7b4a4bb30100000000000d1cfc74bd04c329f14c466b7b17ac72b00818db85bb1069415a898bfa95cd21ae416cfc38e190ff2a631f1f9dd700556d5ad25eef92a5f5dffa5af3a723390c03050000009ac0dfc46072a5736aa2257015d54ecb5490f6811bf9ffee38662c38cecb1ea8a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a4175df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a290f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc66f097755345c31d1ccf8b764bbbd8ff8b8496f7ac88a32f4967b98138b642aa0101000000009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a7517010000000000e7c0e073a254bccce92bb5d6b35da86f6ee1b300fa6d3f54d1414a06745a895d32d5b86fe029e0ab456d2ade56f79d066f3e9c6dd80088c9fdc6e00a4a472f0a', 'hex'), - sectionHashes: { - 0: Buffer.from('9ac0dfc46072a5736aa2257015d54ecb5490f6811bf9ffee38662c38cecb1ea8', 'hex'), - 1: Buffer.from('a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a417', 'hex'), - 2: Buffer.from('5df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a2', 'hex'), - 3: Buffer.from('90f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc', 'hex'), - 4: Buffer.from('66f097755345c31d1ccf8b764bbbd8ff8b8496f7ac88a32f4967b98138b642aa', 'hex'), - 5: Buffer.from('521915f7e75cbde1d94d178a83f6c4ca51bc77640fcd3aaeb28b89ac16620d58', 'hex'), - 0xff: Buffer.from('ae19fb14011c761f61ea480a4d9fffd1abb049be4715f5344d6f60093470c080', 'hex'), - } as { [index: number]: Buffer }, - }, - { - name: 'multisig_pubkeys', - blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000400000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb30301000000c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e00000ba4c9645a23343896227110a902af84e7b4a4bb301000000000087d6e5a4617cce4c93120504a5f5db8c9ce1af0416e260c3fbe9066df3f3fdb2abfda0cac21b97b3e89b3c29013db345bd22548e8baf2df4e682bb4e1a041f0f03040000005b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b296501374229e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897bed4bfd3e247c0ef6e2ab23983a793412fd94a78d9a08efaa94a3d6a977e3c601c01010000000048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d8010000000000cfcc82f327627fed72368dd168663db755478675d812365b9c8b92c36acaaebf1fe9a0494aaf9e675d4b4f041ffebc5234d9da012721b1bd5d1bbc819ed56f04', 'hex'), - sectionHashes: { - 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), - 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), - 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), - 3: Buffer.from('d4bfd3e247c0ef6e2ab23983a793412fd94a78d9a08efaa94a3d6a977e3c601c', 'hex'), - 4: Buffer.from('ea7dd39da3e99c29ee2c51d7bc7cd14754010fa16531ff807988c5018fcccea4', 'hex'), - 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), - } as { [index: number]: Buffer }, - }, - { - name: 'multisig_address', - blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000300000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb30301000000c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e00001ed03655318474529449ed5f0bd81d2cbfa41d57a010000000000682203cfc3d10fd4bd2fbf57181012ca8f113e0b11ae6cd50621a2acf34e83b755fed6eeeb9f6f1c4f55765e2999ce8bd505fb48845e5f810ad57673fcb38e0d', 'hex'), - sectionHashes: { - 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), - 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), - 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), - 3: Buffer.from('d05ef8971a0464a35ab4d08efea23d6c9c86aeeb5e1e6992956ed814d0a3d761', 'hex'), - 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), - } as { [index: number]: Buffer }, - }, + // { + // name: 'update_vp', + // blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33333a30352e3139313137373835302b30303a30305df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a290f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75171400000000000000a861000000000000000500000001d2c18cd88b0100000053e9023f2edc55e90bdcf6024760140a91a7904cb4a529cb1707ea3d34ee685a010c00000076705f757365722e7761736d02d3c18cd88b0100000049a9b2023b4858255845bfa3949e314f241858949214950471b0b598febd7248011600000074785f7570646174655f6163636f756e742e7761736d00d3c18cd88b0100009f00000000ba4c9645a23343896227110a902af84e7b4a4bb301a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a41703000000009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a75170048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80075c251407a7ed91b8114f90b6f454db9071a290458e2db36106b99daf4bf83b101020301000000ae19fb14011c761f61ea480a4d9fffd1abb049be4715f5344d6f60093470c0800000ba4c9645a23343896227110a902af84e7b4a4bb30100000000000d1cfc74bd04c329f14c466b7b17ac72b00818db85bb1069415a898bfa95cd21ae416cfc38e190ff2a631f1f9dd700556d5ad25eef92a5f5dffa5af3a723390c03050000009ac0dfc46072a5736aa2257015d54ecb5490f6811bf9ffee38662c38cecb1ea8a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a4175df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a290f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc66f097755345c31d1ccf8b764bbbd8ff8b8496f7ac88a32f4967b98138b642aa0101000000009fd0df101ba3e91d24f555893ae1bf0b271bd98363d6d4c659876731fe4a7517010000000000e7c0e073a254bccce92bb5d6b35da86f6ee1b300fa6d3f54d1414a06745a895d32d5b86fe029e0ab456d2ade56f79d066f3e9c6dd80088c9fdc6e00a4a472f0a', 'hex'), + // sectionHashes: { + // 0: Buffer.from('9ac0dfc46072a5736aa2257015d54ecb5490f6811bf9ffee38662c38cecb1ea8', 'hex'), + // 1: Buffer.from('a911dbc336d7feab85e374e331542d94155fe25219bad6d7f497a2e5d9d6a417', 'hex'), + // 2: Buffer.from('5df9287d1f3b893eef4643c47a4d40a8838c9fc6a39bbda275e20c308f6bb0a2', 'hex'), + // 3: Buffer.from('90f781fd267026dfd1335d092f0a46d9cf00b8816c5997e55eaf88e0e5cbf3dc', 'hex'), + // 4: Buffer.from('66f097755345c31d1ccf8b764bbbd8ff8b8496f7ac88a32f4967b98138b642aa', 'hex'), + // 5: Buffer.from('521915f7e75cbde1d94d178a83f6c4ca51bc77640fcd3aaeb28b89ac16620d58', 'hex'), + // 0xff: Buffer.from('ae19fb14011c761f61ea480a4d9fffd1abb049be4715f5344d6f60093470c080', 'hex'), + // } as { [index: number]: Buffer }, + // }, + // { + // name: 'multisig_pubkeys', + // blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000400000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb30301000000c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e00000ba4c9645a23343896227110a902af84e7b4a4bb301000000000087d6e5a4617cce4c93120504a5f5db8c9ce1af0416e260c3fbe9066df3f3fdb2abfda0cac21b97b3e89b3c29013db345bd22548e8baf2df4e682bb4e1a041f0f03040000005b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b296501374229e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897bed4bfd3e247c0ef6e2ab23983a793412fd94a78d9a08efaa94a3d6a977e3c601c01010000000048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d8010000000000cfcc82f327627fed72368dd168663db755478675d812365b9c8b92c36acaaebf1fe9a0494aaf9e675d4b4f041ffebc5234d9da012721b1bd5d1bbc819ed56f04', 'hex'), + // sectionHashes: { + // 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), + // 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), + // 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), + // 3: Buffer.from('d4bfd3e247c0ef6e2ab23983a793412fd94a78d9a08efaa94a3d6a977e3c601c', 'hex'), + // 4: Buffer.from('ea7dd39da3e99c29ee2c51d7bc7cd14754010fa16531ff807988c5018fcccea4', 'hex'), + // 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), + // } as { [index: number]: Buffer }, + // }, + // { + // name: 'multisig_address', + // blob: Buffer.from('1d0000006c6f63616c6e65742e6664633665356661643365356535326433662d300023000000323032332d31312d31365431343a33313a31322e3030383437393437392b30303a303029e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be0101000000000000000000000000000000000000000000000000000000000000000032fdd4e57f56519541491312d4e9089032244eca0048998ffa0340c473b72dad3604abd76581e71e4a334d0708ef754a0adcec66d80300000000000000a861000000000000000300000002b3078bd88b010000007c7a739c83e943d4a56a0fd4e4c52a9edc0d66d9105324bcc909619857a6683b010c00000074785f626f6e642e7761736d00b3078bd88b0100004b00000000f2d1fbf5a690f8ab12cfa6166425bec4d7569bb400e9a435000000000000000000000000000000000000000000000000000000000100ba4c9645a23343896227110a902af84e7b4a4bb30301000000c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e00001ed03655318474529449ed5f0bd81d2cbfa41d57a010000000000682203cfc3d10fd4bd2fbf57181012ca8f113e0b11ae6cd50621a2acf34e83b755fed6eeeb9f6f1c4f55765e2999ce8bd505fb48845e5f810ad57673fcb38e0d', 'hex'), + // sectionHashes: { + // 0: Buffer.from('5b693f86a6a8053b79effacd031e2367a1d35cc64988795768920b2965013742', 'hex'), + // 1: Buffer.from('29e3fd2d0a8c786d5318be88f0be06629152ac26628396e28350f7c5b81b1d58', 'hex'), + // 2: Buffer.from('f09f9bf315fe3b244703f3695cafff63b67156f799dc5c0742d1612cdd4897be', 'hex'), + // 3: Buffer.from('d05ef8971a0464a35ab4d08efea23d6c9c86aeeb5e1e6992956ed814d0a3d761', 'hex'), + // 0xff: Buffer.from('c7fec5279e22792a9cad6346f8933c1b2249043e1a03c835030d4e71dfbac3e0', 'hex'), + // } as { [index: number]: Buffer }, + // }, ] -jest.setTimeout(120000) +jest.setTimeout(20000) describe.each(models)('Transactions', function (m) { test.concurrent.each(TEST_DATA)('Sign transaction', async function (data) {