From 86ef20d5c88294382fabcf654e1e7859d3acf923 Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Mon, 30 Sep 2024 11:44:28 +0100 Subject: [PATCH] update tests --- tests_zemu/tests/common.ts | 12 +-- tests_zemu/tests/standard.test.ts | 151 +++++++----------------------- 2 files changed, 37 insertions(+), 126 deletions(-) diff --git a/tests_zemu/tests/common.ts b/tests_zemu/tests/common.ts index 18195c0..3ce6701 100644 --- a/tests_zemu/tests/common.ts +++ b/tests_zemu/tests/common.ts @@ -8,12 +8,14 @@ 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') +const APP_PATH_FL = resolve('../app/output/app_flex.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: 'stax', prefix: 'ST', path: APP_PATH_ST }, + { name: 'flex', prefix: 'FL', path: APP_PATH_FL }, ] export const defaultOptions = { @@ -44,11 +46,5 @@ export const expectedKeys: ExpectedValues = { ovk: '80215c397c1b80ed3cebc4045ffe788a02d03b284b332a26b2b3c126881d87a7', } -export const spend_1_output_1 = - '0201000000000000000100000000000000000000000000000000000000000000000a0000000000000000000000c04dd7b060ee630f08bfb7f04054f5310ce9d348dc0c1596f3032c1951cfaeda8e65caf14c4f26b36dc25e99737d964e06df353fcdca03727ad943a6ff18360c8e65caf14c4f26b36dc25e99737d964e06df353fcdca03727ad943a6ff18360caafc733890d0c20567df066e0baa31eaf4a31e35c0b0dd6663dac2262a14742ffed5794f979679698fefff1dccb811baab93fbf073ed2ac8b976009acd9e64f60534e84dc7150d8e2ed33099419cfa26e6c72ff0d7239489718822c59bbac3fa18abd88cea4fbf3597b63ad4874d17a743f056ff574e103908e3f6090179b8873ac8131c90c8c60a1d3bcd74922f0f5787053668b067bdd22bab38dcd0484bbaf2840e028019919c7853ea5e88a518df05fdb37b70ae547a23f9a04ed296e2e12dab1896eb36dae758df8b79466b1f14064b1211ab2df3d6af50c24389fdaee0b9954d6771a7a8f0428d6cb7ed84ee49f62dd31ef1737f80309486363558d00078050000fcd22462746e72a195b6ded338c0198ce3c0d36b1bea2585b6122e22728d77fa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000824461edeefbf0939ed1a5ae7f5ce9918884e9a5a9c1a135efd93f678b7c335745e58c87b898a6a559bfeae52943f30897f39a40fae2ae12e4745cac40a7e9e7aff0ba5b5ff302848d17802865d308486e403a4320786ea105d273bee98a7b1201ccb2175f16d4f1b06540f5d6c38a8d10bb0499e6ec589793665a2016752c054389b8df50e4bb82cba76cd6219121ef8cff67eeb12c3a377ed00ac6afa2693ffcedd1ceae41fe02aa2dcddf07a8116c4e7bd9f522e113f5a30828be7bb6d21109e09c39f4577368c843d190e77332739700ec769892309988f3f1bffc7611b87d60e47561e1634a8076cb2ab3ca55ac10e7ed7ed9db75cb10edb753d515c424c0e73d9ef194a2c230909c1e896e77e75049d20e0fad6558e628b0264b22fdaee49d7aba5f2e5da42ce024a8366060e186d1a81c4d6b3b15e2305e2b92e550447ca2b40e53c6ce42a180471a568b3c9663c1e62f04e54e392c3e055af8acb5958f0df6893036781b8cce7db26d0141ca5782f8ba0d8068051fc0302f6dca35c254cc4c977bfde6c913a46d2d4e904518c6ed8821dcd43ab17efa0b24a0b7fa0e8ab5a84d050c27b909dcef27c96acc793203ca354154c71c5ab054e037daa99690d38c0e54762fd65425dabe03ca788ed7f55cd559015024650be2bdfbc59a05ff53d83a7c75e256e139278b7b97c7ba87bb01c29e08db7be269ac8c896c5d01390f9f42a79df747c3f7265539b374f40b1bd0923ff3bffe531cdbf911685322da261f46358dbe40e1e99f1713d7e4d218e5d31da6f85636fd5fe9ac229f6a97ba38eed1124b0908' - -export const spend_1_output_4_mint_1_burn_1 = - '020100000000000000040000000000000001000000000000000100000000000000010000000000000000000000cc17f362e79c505cc2087e53c6b17eb449fe76852ddb717721ff2a410e70eba358cd6fcd14bc1f6ca285d23c51c49d03077e2c12abd63e73e6fa833f03ae280b58cd6fcd14bc1f6ca285d23c51c49d03077e2c12abd63e73e6fa833f03ae280bb730d903c34d79ef1e1ea2e09aa16ff29d6837a922ccd724fa1192218dfcd135749d7921677644a343a61be42c2dcc0dadcefc75f68646a6bcd3b530f0b4d2f7ce6230cc2c841291d2f443521d3f965513c839467449ed77bda067d2c697dc23162b7bbe5c70f275651840c323d908e8e69e296893b192b300db7b88a27281df56076b16113ef3c7358260bc204de927a0b906efb6df224ce163d813839d3a02cd0ace47748e9f1d0dd806c42a57f4932ba31ed800b59788b735cbf82bea2ef7c8cd6a13c18fe4c4d7dc407b94433186e8cd712b0462c657680f661a386fcbae3edfc09fc5cfe93d2229d72225d4d962e79ca893e7f1534f4f061a88502a500c7805000025354a2fca8b36199f2b4bde73fa8dfd54783b4829260143e3d4c868952cf41e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085346d42da39d25a8f33382861e0752c084568b9b9bed37dc8faddb617fcab068b7c907374af698d1b1bfb27fdb5b64babb214563f576d2a3426a9672f3a98b9cf8863797d7787dff7fbec75a7bbb0212cfe2110f8d3ba2503d1668050d132a30c635d8112287e082db79a63a32cc3a010a61c7c7eb3db1840d1df9b80f484acf4469480b238e07b25666e64dfb8cbe3ad2e52a2638f6af31c883809655c70887ea9ca4b13c63901c33fb3abdc7422af44502bc09da52e1bb65a776b5ae4822a3282465b77032b5061d48418647bd3c8ba448b06b2429f188f26a0ca67761c028e0e8f0c2ce89ff3276cd57c0178e4b95b85ccb05e4c37c9d719a16802571c725cf712d5d8c38aeb7b781d588953212cf9ca06a64d68d7f82259a7781bf093164d9fceb3ed393f9b47001c3b081932fa17b5e7d3786d75f950da0b9ca118f1a86fb9c7fa36bbc8b31fbc5bd2700488f4f12e8056761b0aeb71970904b466a3ac65ebe046631e012b946b9375acc1616463211dd6c35c302293e10f9cc0b66769f92c5bc5d70137ecc97822f5b353fce5ecafaff9432288715af37bc403a1dce414e7f818839c21a68ec3174badeda54e2eab8048bded469ce79583bf19f30c2e167e29f4a3980765bb09d7d3cd14aa194680c7c97dc6800f193e8c663cbe4bfeb5ca3d2bc4b63d851b07907d4453756a03e4f94e3ddde3fe85ae62335c07ab1a89fb5ca5a5fd512a924dd6ab92381d16787bb1ae8b74167b0db7b04deec50753bef537ffca9a2908109904e5d98f53435fbc210efcbab0298394a1e8bbb141e8c0e6cc4fdc9d905e327df36af2e09ff22e6cf6b2cd29ce5f8e85ab3fe0d0796a73752f83255093f3094d54ce7789de77bf88ef81fc9d9dc08d4d917340bc3f4b85827e6124c806ed47a092657f8e9169d23d5120b5522ee9939231001d90a74c34e79edc5443519c952fe995650bd2e3bd9fc3cabc4e9cefea0aed8738709b3ef3e40de90ee13e12d604ff870442c34eddf121b4186e04270510dab936bb649f06124dfafce459b01cf7ecef56675fa84ff769adaa0eeeb042d6a22baecfa757adaef8b793dbda59da72faf281294a310cee94333fc4baa3cf8dd1398735b58fef0e291501a2a3515edf90f6dd17f66cb7c6340d6998e6e74f5dbd8c57b24aa2eb29686cef57ee9cbc6589aa1425456e36df43c807372224db320dfce8b4c0d6c7cacf70034818ebabcce377134d85f9bce38b8bbeb90e91b27198614f1f700fed1263ab5cd08b5a0984e8954b33fd2a87f59ae6d6003446897aec048ec492bb2eec9e667aca3496c3464735bc495ab86106f61defc91896c00dbd770c1015ed53725195748bde73d0394e6755caa2745774e6044e72eaafad6f974c0773cec062db2d6154e68541abd4eb01c040d645a45ecb9d97b1fd224fecf3d01cdb785f1a0c2dedd326b38bb47428d793bba1acae299d91ab368072e6874e9f6cd59b98f1f4cee8b3819cdd05cffbbe606664b82501f17af05ba057e6a856097527eee783f48279bdcba6b05cb247d28fc1f47962364f9ca16b7c55be4b36d34df8441a25f77da08c7c7492ee66230effb8e1f8027b017fd1a2f61ca93301f1ec9a9a5b30dd33d8124a8c902d790c413ba1f77d94773e86059faa3cdd7f66a3aa709820b6324a4440f419b1f4b460dd9004972a981f8d821a499bc97c3ecea29c0c071048a9fd92db521df33bbc717220e72519d1b58cf9731d36d4eab0211515b2db4dadc599abe20acfcc6ccd027fad9e77ee78728028211e3f06e8827d6360bc80dc47481da994a3f2a6556e3e9df9d2624ea8fa0c4029f2e0545dc43cdc92ee12aea4f637c0e44819df4df50563ae25bf66add4b3191f72cbf99f8fc28756b77d1f57e7fadd0b0130455800aa842cf0b448a08e2f310d9a0d60da1c956344f2775fc2f3720f560f2b71bd477bdc9200c92180b07132cc1d772d83644c428a464935d18ccb086fd21d44ebcfba6e394efa0e4f2467d6591799931e401a3fb091cc718b13a51aaa63437db6d89deb53cb3305f582b4d8d5d17aeda9b2d4c20efd21dc27bcd3c07d4342505c080f989161108bf736c42d5169c458553304bf30beaba533fb10eda27456fe0ab1124ba57d4640920e6a77066626288b3cf50bc44ace59a051e6cb50201231767fc024f0590e19415716148cba36c1a4d7d1ffcccb37e2e2987dd592a65fa578751a6b4e841f70f597fec0b75df64bcd3802cc4536e9a4e635e28969590bf6ab9452bef58b58cf796929763b87842637bc081ac264c9157256cb71298cfcd49faf9b08996b756dce264bd88782070a0b70f66f7a3b619e3a9bc251415319778b4f6321362088e693ff0ad2fe8e10405cd1f538a364fb5c6ff45e4781d1cfc2a5296cd105066ded937d9330020712ed3921d4a3c52997965e354555c09c49b801dfd6c126449f379db6ba77a6903d448f52d593c52cc5728718d8a952951d0c7a08c7ec42b2c9aad21bc8108db8cfdc19b1c51d9361d7040970286154ef482323106f64002d0cc74c25bfd2100191558d6f4d6b28c50e33e0fbba0da76f4baa670bb250217c2bf6804b6181da67b0e72019d14a3169f3014d5bcf37a596bb3e94edf50540dcba648e253177289ebb93af6c63c6d5281735ea16f6032aacf98135c02dcea89d58e11bec8c3b77baeb337b1ddf537aeace12074a4c6c1dc483c670b9a2a84511619ec6427a30f674e25a5983ab5a5850c7823dac5bb2eb52c4298c94238f68450627510b8df5d270c396a376749684516c9bcbd9d5c740048a6d0999b1aeb367282ef2ea44f8682df083c746126952c8f336d64c96ba79a120180c94ad00ebc8c889309018e7edaed980480a594b80dadaac5aae617355745eaa56e3d4af6bdde5b4dd5329537f4dd64218d0c60c591a893e58cd6fcd14bc1f6ca285d23c51c49d03077e2c12abd63e73e6fa833f03ae280b940ba10b11beea15df01b635a2a1f4b94f8d97c9857017c0ca862ff432f636735fa1170270ffa2b0ea52f422cfed3dbfb2e1e35accfeea3536fd94eb45cd97a335bf5509def24115ecd732cf9f11a8b05396f7d5078078d83af376e82af3ae7f06c1e1d7929dfaf3925355b0e7d8b52419737bb92a2b9a1aa6f6387bafec53e312ceb75e09e0c631d844eb8f2fd6fd8ca8292132470259033f06e6d11eb5706a996cff916f25cf9bcf54bb298bcf0b4c85a7975b79d265468ce842806a0c5fa39e572b3f2d545587255ff0d869af024320e0fae1e71caa6dee6c54adedbb321754657374636f696e00000000000000000000000000000000000000000000000041207265616c6c7920636f6f6c20636f696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000009e572b3f2d545587255ff0d869af024320e0fae1e71caa6dee6c54adedbb321700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000db661ed91e173c91f64498d2ddb95acfc82f14048bf9e2725e185789bce93a30200000000000000940d0d422bbac84d7631d0caf3a0f50d3ab053d460a6225e079049f678e8a086807e5cf8758d69a61afabf6a478eb9d46245d2e4bd03ea23d26bf8e8331da30c' - -export const spend_2_output_6_mint_2_burn_1 = - '0202000000000000000600000000000000020000000000000001000000000000000100000000000000000000003d4b6d6a119119f2775a64db8c69bce1a9c19b7786d26ffbf47b4b11d27ad95ee0a20be7f57278e50d05f5f63b12663e29e2ebf4ce088d74e19a3cdb5195110ce0a20be7f57278e50d05f5f63b12663e29e2ebf4ce088d74e19a3cdb5195110cad6dec462f0e776289c0cb89ff344efebc255aa8971af4c7a89a557d3d98efaa2d77e00dcd55f9403f2268c1cfa156348563bbf9bf7f1d576e9098d41b96b5a9227c8462a91c4ee2bacdcb2368d65bd184cca5ed87f61d52ef116e788d456cef0f989d69632fff3be8ceb75439c7d310fa332edecbbd0a6145ad513086e5eaf15400eeb824685fa5efb0389aa8cbdbda91bd3dad85c79d2036d53ac824445dfab2e16b68ee8e4084dbcc1e9960ab0914b9c6c82ffb8362f280ba49c53c65ccc4e7c43fa19bdc934f6be5cf140705acea770062a43c5dc24e29a009605a8a845fbd6c43d21f777af45adb1e1472da099591737642abab182a1d7d24a1fd559e43780500004bbf0e3f2ead7c7aaf34c81fc5e89e0ec7b42d9ef45f9ae11218c332dcc0763600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0a20be7f57278e50d05f5f63b12663e29e2ebf4ce088d74e19a3cdb5195110ca8a95853a6152a53d5b5a8491db0b2cab92c84b40d2db04738dc8be8f3563bb9a591745869247c69cd2407b85859ca8ba704ae7ad6e907824dcf4136a7579f36d6082c7f91db7080839bcc2a1612d41b0b6789a743ae4ba2a3fdfd4310cc95c210d9773cdaa143e286ef837566e33ce2cbb73b6227c98503520697f4b603ba0f786fa7b6653eca28fa9e8d8626b368c7a0100e0a198ad9b33640a57d246cab5f7b82c77f94209067f8d83e9f20ecd9dd01650d4f4880147207a359a6e083398e570be94161c04745558f0badac97607d7c016923dba282180b4efdb1c5e3fdb031f9898c96d1d037b2c26f6e9f0ddcb633a25a60f4019a7157bdc5f18c4c4e4a78050000db6eb7190e809707084b37ec5f0faa97f6799304c0d21ef30f36e35e520202f900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b99e8b273922ca8e0bb8a83e993e39d414ceef58f79c4864a56c0ec599e722cdceb3d4f18eab3e6f19365dcdf122bc159685fcf52d1bd16ad80eb9e3cd3fc208bd5b84ac72c0b698a091ed4a8f4ba9f886ebee44fbd46608f1fda785ffff80b614d2cd35affcd1137a637aefed866826c3a8aec2aac07f961bcb0957f9750750eb50f86adef21120d9121491665ff0c0807fda2ce96f0e414a4f860ee7eface8d59ee104155ba16659bd987cc642ee906c068981a2bdee6b985646d3b63c1b76a03b9f975b91b415bd92052b39dc528064f94c565a08739ee856afeaceded535a0014e1ff1f6f75ef377db821bbd93eaa53b3c941ee41e80be87d36c522c176a264ec714d655d80be0a4296db44b717c5334de7f283ab96e6548311776d5de3c399ef95d6753b5cafd68614db22ea6606744fa6e2fb7cb27928dfa7472bfa77a574bc8cd055b749148be813bd0b5d42bdd5595f755069368a245a1c11a24c79f874597847a1d2d4468bbf78e469b099f48f580aa17780630dee20c7db45bcbba1df1411c7e9dce47ce9d7310090d8fb58efee6e05b1492d039e7ec785b3f41d52ac68b0470dcdb23a372b031c2ba8a6ffc700c730531722ec39761eb1da7835deb44b83a8916d05ca0885de035c7599e1a0bdfd88626ee5d5168f634c39d043cc0516b61a4b8246f6cd3e2e6e35892baca134913f214046cfc6f31551c273d154cdc5d08d62fb7808977ccd9a5b1ab3db8577ff920b183d9211f663094adc1e22af81225923afe4a4f1090a22d6d71d3ebc944facc1080d5aa33e6cbbf6ead3095a8f149f5f43a61377c95b18de18347e1e4a249fb932c0a7b63dc53acd5145dfc4c8f501652a7bb178414c97da7a31660d1419edad0199f7032d7bc41892c63433ad100dec12a9bd46413159e1d7d6dd9675ab8dc85b88ca7fd15591e3a7ecf0664c2c872c1186c573ea994c47a6b9ed388d976722c93e96be80cc0f6a24df59bf3347e296ccacb211d7d9e9d9077713606003523e162938d966b4406f9386f8d7e6b4c3e6612ad35dba950b271b691d8f35b5ec50430979b7eacdff5b9b902768d90cc04b482363f12136cdfbd790616ed1681303674234be264c1bf8163971afcbae99ba46b47677866c0e80406785c5f0f122e4b058af30eba808cc37fe094901ebfcf2ebcb20c594e2ad5cf583a72ea665d6c759ae339fc617fc55d8261e5d48867dc0709524921a5677f3460772a1a2d4fa604a885455c6549651941f25a949865c757a3e41323be4f833fe4dce38ff0fb3affcf15727b4ab3a4d02aa42cabfae9b418d2637f950c4c474fa70b5c40a6b00d50f696e46e4652ac54f51d8963bb5eb4bf93c50a0a41cac7c722d41ad8a9bfeeea690b91901e8d1b2e25f46a5873de676c935219b1483108db3e39d4f6bcd6ecf041bfb10aed9189fe0acc29a8ed4d792318714904cfab00e4553295737f32d511e972af845eeecad89f18823f93cbf441baa4594c35b4685ca27b158755f0efafa66c5c31ec744c5287448843f3f614eaf00f2af121debc67340b8479b9c0b621f61c74490eaa4ff5730bf841cda0b2af3151ca99727dc75b608e0b60e945847e87e9e8c3969fc4a14a8915bddbfe06f3532c7a91bbf37eaf49b2c8a5baca716862dc60752c44a615a454a8ab3418010d1f840ddb4acafc32894c9c62c0273df22ed3585022db8cc8b5130898a0ac322d68201de0259d317289cbf627dc0b178edd8f397b3b164c8b21254c7711058081e2f13d56d838fda085af5cbea790870664f69c413bec3838e4ac1795727ed20a0eec3cef840d17c158506109a92607ea0111f59057c20403914bbf454657e324bac340245f0f871bdeb9af1c3bb822fe8928ac8657724f6625a5658798727b12f98c4004203f7e27c1b40a99e3942864d61d925368fa42abfc9bd21393a33cfb002f35bef3a77c1c52c06ed1d9451000486defbeb302e6bbd58bdbd3a816234611d6fbb0eb33833ce4c93e1c64380144eda4bf43cb98ad2b50f0fc19ce1e06a2fa58798513f7088197f94f07f64d573d7c86666f0c91eb8a5d10f18dc6f8efcf40e9accfa7160dc35f625d6cf449ec5d5608e346d4064df7276f7ee09a1cc587db9c847dbfc5e6d5e3216b96a703886413fd3a1480dc3cc8226d4512a8ab7609dea660d867029ce33e18c6d14a34dc43691f8ceff5a057d82d827a53b2ed98d55f1c0e5bc0397ff8ebe932eec142f7d41b4d5b9adc5986df442bc72e9fd94201c96cb35afdaedd981e48bffd4131a362f32a230487d562a70ac7e73968f6f6fc4da8ac2dd933fd89c6493143f042563325fd02c6489e3604f56fc4daa9c6f7702123732ed1976236e639386bf42527fdf14f0b1665b14bc59038011726d3c11695bb8c1b297ffbbe4c8812cd5365fe55580b6999f5f687fca1e7c1c2195bb2cbeda36d5b171d57b9d51bf90b2980ff76e8f41bb1fe3aad9cb97769cc50ef7513513324bdfbc7e0aa1c212dc03952873e3fe2fb92b0868cff1884a7b895e090ef3646bfe12e554c50b399883d404aa800f44837c2ddd6f394e545014725d2264437425ac8394e187d0366335750c6e014b6e3b783e7e48148483b1cf6a47b49b70c43f1ee3df1ffe59dc43105782221212f3d3ddc9d830bd28bddca26e136c78360ccbb465c77b3a3613999f6c8a09316d50b7af595f3fd030ce77ca62477391509e9055ac3d235bfad8676b51f697831dd4b6e159852d062b4f77215e0742c68d494ed438e77fd5ad89f6dc7cac095ba87def81667655f0884a93bd7562c74c58a1d5c03f89f37c01e1898d31d44e2c1ab30e6d353e60a12b9ce34b83eccdd898fd19a856508d0abeedfd8f2ad1b8a975c3a679df0d3c96f2b67d06f36b976bf062187880b8f70e20979c7bf5294a41e32d41fe230142bd04b12aa5ec8a5d86a6edccfeffdc15784fadff36763949239c57e2e0240de37aec9eeaa1ff5eee9d74a6100b61c410b2aab51ad8676b8ba49796c2c32ab95e60977e1ebeb4aecdf60d65a9ae1af788d40d2373235ebf7d14d154d9eb0bd2bc11db884013f910c50bbf1f8f33be8ea3a1faab91a0d940fa91c4bf0a780a9f51c8e0b986c1e50c4048b746f9f283add7df4117e81c653a06d0873ba704e2708fdf7f85a656b7b6fa447269db895d0c0d8117f8f74b7d8a80635c24d64d5fd5866a0a2b86858f88ab1219389c0e9c76d999a7ebdfedbc561e24194131943045a96f50293844e49abed53a7669b568dd50fce9cc7b1943852af43bcfe0a08f68b1fda352063d53c3c8b1a3af0e9eea0b259d1e7ef0fab767516c26b4094ffccabbf4badcaa6be316f11bceead3383555793a7f641c42f141ad49ebd6ea0eb5a77dc95bff683388410c16ed2a2575b606e88aa29d67079e31c56e288b5f42bebc7500923d58765d1994790152cf4dcd54bbed92a81fe020ba2e74f97d73f83ca5ff763df0d51500fa71887df1053b1d5e8394067b4b8d02263cce957b28499d417a81aa6bc9eaed7b259b8875fd74890fd63763f5d92cc4bd2c072f1ad659045186c347839b52c71a033affd2351c8dc30111a2fc2e5c3d0f4df2a5ae4d8077aff77d8911de9af8492bf665c328cbb63e4044760f4de518a0390fc814f050f8153b5f394a16159d030845ea021a8de09dae18bbaf7f84d77fa06ebd6a77fd7a58e4e3b61d3d7cca7f45aa09eb43c42f8e0b94783cd3d6d153dd670728c8b31d735ac68dd8ba4d5f5533f9804a8a3ea2bddc638d2b3e827878421c33efd4bce8295d1813724db9a3e64209c6d4f0b56eb78348612bdcd2446104935d6b7b4d634a1d81069a359aeae0a8d68b433328a6716fa865f2c8f9ebfadd937768ca1416f732b4683e3c80deb0a31721df6843763a18addf37745e043a49ed255addd7b1bfaf687feb03c3041ef41ac68cf2e79488817fddb2591014aff2b915d13a85bcbf358fd0b77eab81599ba13d61b47012334d5e9e8e0e1676f83ceafff38e21610a58a02d0e11e6d0a077d09cf3e77568594eff4dcf9a3d18b35c11bf8d5c135a288044b35b41d777ff2db7c1d422aab6cd031d072e66a64f65de63e0a7c1f65cd1ca081c90f02032373a20d05a5fac0c63246eb850d941d01cf6ee7ef4ad64a16f848bcffaa9f82bebea432eb41d73e9c3d2045e0a95f35749fc21072c80325544473426f58479a1f5fb6cf5f483715afb242fff7d10b7ae3f8bf5b97e6b95a441b9cd73d5038b9b5e19e4ed091afb430badfc8654965b89080308827526d4319374d167df69f4213d2c3f65ea863b75b7cc7912a72935096f7c66df78a707563a823eb4898a5dfe86f67b3f8d4d81f8af4fe4fe12a409272eb5ee02d9edf9b57ede80941a37ae5e47a9ac7929239e0e65dbcb0afc8e0a20be7f57278e50d05f5f63b12663e29e2ebf4ce088d74e19a3cdb5195110c93f374b43bf10a21e54032ac63b9b79119e1efe4afaf545867a69a5775c69d482103cbd52d3ebecb264a4d98d3147cbc88c1a4418098446f72466e1060f86bdc216ddffc25ff9ef627256542028969fd2f0fa5aa5d2d9cf89c1efe4769fc2fe10f5cc9dd8f4495f1e376ce148f03d7421043d18c10728dbf8c3f80ff17a8dd59467e824f67bf62a2d695bcf7ad427a7c940a4b6109c7cef8de0d69a6f87e33f986341162fb9bf228a149b7971584155bfb9e787e4c29544ccaf7b7c70d74a4d78e52580849d7b5851c34ee8b67c9fb5a85c8cd2bff36140883755c5f2d05668d54657374636f696e00000000000000000000000000000000000000000000000041207265616c6c7920636f6f6c20636f696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000008e52580849d7b5851c34ee8b67c9fb5a85c8cd2bff36140883755c5f2d05668d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0a20be7f57278e50d05f5f63b12663e29e2ebf4ce088d74e19a3cdb5195110c8e48070fade17150606e1154949f717e7ee317ec0d6b6f2c8922a9d65c3af10518d6a88344477c55732f7e7ea625f0ee9054f6a22b1550966b81a8dbc67b87f1601818dd67d12924696c9a3d19e5d454394951b9c81d1496bfb76f9c9d124db40a321f2fd7b83278cb76ff313ec2044bfec73b1606b82e67d69ea967704d8cd027a65203de39581076df6b9fb11f8bfd839a156c6ab4afd5a3643e600ef91df624a59839446903aeab89bfa2ba99897a1cc9a7339d0b407388c098e80792fc5e8e52580849d7b5851c34ee8b67c9fb5a85c8cd2bff36140883755c5f2d05668d4e657754657374636f696e00000000000000000000000000000000000000000041206e6577206f6e65207265616c6c7920636f6f6c20636f696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000008e52580849d7b5851c34ee8b67c9fb5a85c8cd2bff36140883755c5f2d05668d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9928954d4c98686796a2b214443b90fb8d44f5297006c80ffc336dc4f0c30dc0200000000000000cea785ae2b10384eba0f91f6dad392c1b07a7e099a9efe49a25ab38d43cd660d1ba4283a4ac95fb5504ad44ea8f723cb4745c2c713270c29cb84f65b6d41f903' +export const tx_output_3 = + '0101000000000000000300000000000000010000000000000000000000000000000100000000000000000000003475b26a991a739f6b77dd7bce822efa46d355a28cf0e4dc9c93b6ababf073c5ad26e3f59270401ff48e7ba11d800eaea4d91dc89d4ccf0975afec009dcebb07ad26e3f59270401ff48e7ba11d800eaea4d91dc89d4ccf0975afec009dcebb0795aef72203054fbfa24ffd1c375e6d69827111b74805477b38ef4932d143c6a44efc37619fbedc3a1b46d5613202ac6baf75caadb2ac6b6c9db0b02acf8698a1f51eb6a1a1dbebf7fa0b034803716d103c96e9893180cc971824bc2b978e1b1600ebd35de5d6b921b2ce8aa4c03ef7312c9d6efc7e259f4dd68d5c7b632a88bc259386faae6cea9e44e232a6cbf1079486a29e9d622e3c25e1985155226c4d48342be389600dc829f89aac5a81c444fd880f5b5ba1541b9434d620543a6e8be7eef40fe52914631d18a7d4dfb1c41beed6c2b7a51efd985f2e210059f36f6000ec8ee990b1228496c0d1140767f2aae76d79e09f5f777ff5af0f89ef6aefe7337805000045e9b744ed2afca6615aa6ba00dcf578979391b219ca05e90447abf21315a9be00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b9032b6225f92f518e019f07373891b6524df7bd3e25afc0b0fb7f5ca2da049c419860e0eb24aff16d830bc21061662393a76e80b2ef434d6f9bbfc3926644e933210d159074e80b368c16312710226160c38e0b05e69a8f353c5de3e0e6fd1e03892c58d7e8eeb5604aab425b445d86e9357341e2a175b8835b99653d75ba42c11500beeb61c90523a7dee736d73ab2a6e496b7aa8241ae8bd222475f3e0b510b0f5a57c5a97583d342d4c8740f66fb856d730caafa608296b2b02aa7bd4a99499b3cde309b75e0200df587d09952547f29046abc4fdd47714860d09f9cdcf3f3c24fd8d8fd0e0d2f83f1191ff59f37fa811d1a4c90faf70d4da89ef228ce6d8d0af19c715cae4d74fe07d3d66c473dff6799bc3d8979fafd5a9cef9b1d7650a1f488cd3478146e27075c1b1c73697ba64e94b37d13f29d22068ef58a7a721138213f218a11d1ab4b88d41420b40a010c9cbf2e10f00f7ae52dd54eeb9b716fac76db7d364b5cf43d278b61a0863234c03485364347505af9c86b8d582c453c1c98e52882d08e49d496791a899796ea3e5773435edc97caadffcc579341474cc31b87e6b19b0d526618585a6693184f903512ef641eda23f30e3a45782e95d1c3529230566b78aa1421834c58d0d44ab79467aff475858a38cbd67d4c4af4ed0cf677a063fea0b38b193ab6a18d81b3848f941d61b46bd86f348c613a9b0dc18610fae24d7328209168bb05d58d1085496a5a4769da339fa3ef1463956da25ccaff94a58beff6417d3f94d07eece27b8ca1db74ce29cce9a40556f8967d5ebb58da4efd01e4fb9b27578fc8e883320cff5f36a1b69706816cabdaff3ba9cb06756d8c37d760419d05bd9b8ffa84ed6ea98b952f0ea2e927ba0782e90a949b8821c305c20db46d66c00b48fc4150eeff0bc07a6fd890c80a802657573703a1b7aa9bd3b6eda9ad2adce2f162d1117aaf08093c779dd4db20c94a48e62357ade7daf5284d3b4d2f6885dc03a34b48aa2890ab4c60128769bf8bef2ee7a06f4d552eaed15c4df1da5ccf3762f37b818c9d62f7464416bc40f59c4f3c6299a929a67dd3d09e00d1bd68c16d38ee66e34b54272e0fdd2eb74c91e2eb66d4db7d061ddedb0b88f709fa9f027b00a5fbacb4f70f48612b11caf119866afea8a05de5b9e63b096e45634d7d68aef803cec2d21f91a55bea60be8abb233afe7dbbc415546945350432dc858064d42b82b0f0397fca660dddd45e9d95898d98d2fcbf2eb0c5de920aed36f3f56b511dd1ca5551a14b5d1b235be781c7c1a6f3297d4bccf83abb11bcaca33e12ea204c06849b39dae12e0cee817e0cbde1b1d1906b88cac1d96ed59c1377a0f7eac1a4efe9d2cafbcfd0c270f0d8311ac9839ad60cc834c1785e2796485dd844fa0694091206f8d3563830c2160a5510a41970da6cd5a0f810d36df27339db81152a7c2acc2f958f8d847ef2a9b18862eb2ebe6e2a635f905db4416d594d25268c61d163ee17d0b9052a6103d70139ec53b9f8328d5e3eed90541e494ad15da810b71fba9543198a4505e464608367a7fc83ae6ac1f7a63f3594d20452d928b86bbdccda5f9257f615eef5f05a7513cff8d074860980bca8873d387bb23894694650c9adad3ac1ba0ef617dbcec9946d874516131944e6e3a10eb017d696a20eaf9af5ffbc83b8f2db1e2cf82bfa1a2072523b844108d8fa9c980443c92121b2a2d47114b4dec3b0dbdab9ebd96295443d8a587682a044c2cc7ba72e9842ffb1156b7c774efdf0cdb5f96be7ad6cb1c361e3d7ee645c0c57dd23b4d247d940063cfa8a4afb72b671cc1d6f9037aac0cab8852d606d5616f41a3f8d7901176060a75e4c9e18d65cd2679fe5083c6e40e247c74f29b4ab9ea38827c7f4d1f1fac5a7409262374adcf69975be903a8561b83e37980567fd179e0f7eab72cb77f5fab2e44e49f8cb75f126b5d60cdbcacd00ab422d48d32d2db75442549ed7fe4b220ca969a9d8a4248cff3725f34cb64c6a59e73d8e841e5995075f32feec14d2954af1afec302d30d24214025e833f68676b1242f27dba75dd53426b46ea4fff0163ba0cce0e6e9ceecd5191199f5c9b867e62a4ab18781f7b440e6d9470ba05f09f0ed1062a745f4cb952ca862c91c3d3e88779f51c43bdc0973f03b5266f3296772fe19ff078ad2b7f237fcbbe47e4d2ad26e3f59270401ff48e7ba11d800eaea4d91dc89d4ccf0975afec009dcebb07b1ed0a33d8f1fb025d2fdaa5af2801bdf2aff84d3b69bdbf6882b424803170ff6db19d9e05cff32d44dbb9c5d6c5e00683956df74a3db738668124f64928c5e10fe1b733def7f86b6532c9150286d71038490e719cd4dd271e883bcd278750140ba5b3dbd716a40d94a9eeed141ae4a6d007b8cfd43a175a6c862df720bd03f7c38706371ab73ab00489294f72c6b18eb470d8f395fac71672ae4b2dd9afc8cbb986aaab0a15954d29b323fa21c13772068078845159b7b52a5bf766cea25e2640fae059d8ee3361b7a08429867254523f937c7654ae6fe7b188c1f0da57e9cd54657374636f696e00000000000000000000000000000000000000000000000041207265616c6c7920636f6f6c20636f696e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000389e2f71e4e9bc3e37a8b3a5b49432f7a93574eced25fce9add210b41203ed42e414a3468188977dfa4f1bbb2e36dc1bce38e759b8a54c85bea6d75a2aeea008' diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index a53f21c..71b9c8f 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -14,11 +14,18 @@ * limitations under the License. ******************************************************************************* */ -import Zemu, { ButtonKind, zondaxMainmenuNavigation } from '@zondax/zemu' -import { PATH, defaultOptions, expectedKeys, models, spend_1_output_1, spend_1_output_4_mint_1_burn_1, spend_2_output_6_mint_2_burn_1 } from './common' -import IronfishApp, { IronfishKeys, ResponseAddress, ResponseProofGenKey, ResponseViewKey } from '@zondax/ledger-ironfish' - -jest.setTimeout(45000) +import Zemu, { ButtonKind, isTouchDevice, zondaxMainmenuNavigation } from '@zondax/zemu' +import { PATH, defaultOptions, expectedKeys, models, tx_output_3 } from './common' +import IronfishApp, { + IronfishKeys, + KeyResponse, + ResponseAddress, + ResponseProofGenKey, + ResponseSign, + ResponseViewKey, +} from '@zondax/ledger-ironfish' + +jest.setTimeout(500000) describe('Standard', function () { test.concurrent.each(models)('can start and stop container', async function (m) { @@ -33,9 +40,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 }) - const nav = zondaxMainmenuNavigation(m.name, [1, 0, 0, 4, -5]) - await sim.navigateAndCompareSnapshots('.', `${m.prefix.toLowerCase()}-mainmenu`, nav.schedule) + await sim.navigateAndCompareSnapshots('.', `${m.prefix.toLowerCase()}-mainmenu`, mainmenuNavigation.schedule) } finally { await sim.close() } @@ -45,13 +52,11 @@ describe('Standard', function () { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) const resp = await app.getVersion() console.log(resp) - expect(resp.returnCode).toEqual(0x9000) - expect(resp.errorMessage).toEqual('No errors') expect(resp).toHaveProperty('testMode') expect(resp).toHaveProperty('major') expect(resp).toHaveProperty('minor') @@ -65,14 +70,12 @@ describe('Standard', function () { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) - const resp: ResponseAddress = await app.retrieveKeys(PATH, IronfishKeys.PublicAddress, false) + const resp: ResponseAddress = (await app.retrieveKeys(PATH, IronfishKeys.PublicAddress, false)) as ResponseAddress console.log(resp) - expect(resp.returnCode).toEqual(0x9000) - expect(resp.errorMessage).toEqual('No errors') - expect(resp.publicAddress?.toString('hex')).toEqual(expectedKeys.publicAddress) + expect(resp.publicAddress.toString('hex')).toEqual(expectedKeys.publicAddress) } finally { await sim.close() } @@ -84,42 +87,19 @@ describe('Standard', function () { await sim.start({ ...defaultOptions, model: m.name, - approveKeyword: m.name === 'stax' ? 'Path' : '', + approveKeyword: isTouchDevice(m.name) ? 'Path' : '', approveAction: ButtonKind.ApproveTapButton, }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) const respRequest = app.retrieveKeys(PATH, IronfishKeys.PublicAddress, true) // Wait until we are not in the main menu await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-show_address`) - const resp: ResponseAddress = await respRequest - console.log(resp) - - expect(resp.returnCode).toEqual(0x9000) - expect(resp.errorMessage).toEqual('No errors') - } finally { - await sim.close() - } - }) - - test.concurrent.each(models)('show address - reject', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...defaultOptions, model: m.name, rejectKeyword: m.name === 'stax' ? 'QR' : '' }) - const app = new IronfishApp(sim.getTransport()) - - const respRequest = app.retrieveKeys(PATH, IronfishKeys.PublicAddress, true) - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - await sim.compareSnapshotsAndReject('.', `${m.prefix.toLowerCase()}-show_address_reject`) - - const resp: ResponseAddress = await respRequest + const resp: ResponseAddress = (await respRequest) as ResponseAddress console.log(resp) - - expect(resp.returnCode).toEqual(0x6986) - expect(resp.errorMessage).toEqual('Transaction rejected') + expect(resp.publicAddress.toString('hex')).toEqual(expectedKeys.publicAddress) } finally { await sim.close() } @@ -129,13 +109,11 @@ describe('Standard', function () { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) - const resp: ResponseProofGenKey = await app.retrieveKeys(PATH, IronfishKeys.ProofGenerationKey, false) + const resp: ResponseProofGenKey = (await app.retrieveKeys(PATH, IronfishKeys.ProofGenerationKey, false)) as ResponseProofGenKey console.log(resp) - expect(resp.returnCode).toEqual(0x9000) - expect(resp.errorMessage).toEqual('No errors') expect(resp.ak?.toString('hex')).toEqual(expectedKeys.ak) expect(resp.nsk?.toString('hex')).toEqual(expectedKeys.nsk) } finally { @@ -147,18 +125,16 @@ describe('Standard', function () { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) const respRequest = app.retrieveKeys(PATH, IronfishKeys.ViewKey, true) // Wait until we are not in the main menu await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-show_viewkey`) - const resp: ResponseViewKey = await respRequest + const resp: ResponseViewKey = (await respRequest) as ResponseViewKey console.log(resp) - expect(resp.returnCode).toEqual(0x9000) - expect(resp.errorMessage).toEqual('No errors') expect(resp.viewKey?.toString('hex')).toEqual(expectedKeys.viewKey) expect(resp.ivk?.toString('hex')).toEqual(expectedKeys.ivk) expect(resp.ovk?.toString('hex')).toEqual(expectedKeys.ovk) @@ -167,71 +143,13 @@ describe('Standard', function () { } }) - test.concurrent.each(models)('blind-signing', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) - - const txBlob = Buffer.from(spend_1_output_1, 'hex') - const responsePublicAddress = await app.retrieveKeys(PATH, IronfishKeys.PublicAddress, false) - console.log(responsePublicAddress) - - // do not wait here.. we need to navigate - const signatureRequest = app.sign(PATH, txBlob) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-blind_sign`) - - const signatureResponse = await signatureRequest - console.log(signatureResponse) - - console.log(signatureResponse.signatures?.length) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - } finally { - await sim.close() - } - }) - - test.concurrent.each(models)('blind-signing2', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) - - const txBlob = Buffer.from(spend_1_output_4_mint_1_burn_1, 'hex') - const responsePublicAddress = await app.retrieveKeys(PATH, IronfishKeys.PublicAddress, false) - console.log(responsePublicAddress) - - // do not wait here.. we need to navigate - const signatureRequest = app.sign(PATH, txBlob) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-blind_sign2`) - - const signatureResponse = await signatureRequest - console.log(signatureResponse) - - console.log(signatureResponse.signatures?.length) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - } finally { - await sim.close() - } - }) - - test.concurrent.each(models)('blind-signing3', async function (m) { + test.concurrent.each(models)('sign transaction', async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) - const app = new IronfishApp(sim.getTransport()) + const app = new IronfishApp(sim.getTransport(), false) - const txBlob = Buffer.from(spend_2_output_6_mint_2_burn_1, 'hex') + const txBlob = Buffer.from(tx_output_3, 'hex') const responsePublicAddress = await app.retrieveKeys(PATH, IronfishKeys.PublicAddress, false) console.log(responsePublicAddress) @@ -239,16 +157,13 @@ describe('Standard', function () { const signatureRequest = app.sign(PATH, txBlob) // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-blind_sign3`) + await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot(), 200000) + await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-sign_3_out_tx`) - const signatureResponse = await signatureRequest + const signatureResponse = (await signatureRequest) as ResponseSign console.log(signatureResponse) - console.log(signatureResponse.signatures?.length) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') + console.log(signatureResponse.signature.length) } finally { await sim.close() }