From a0504d5c9a5a266a2cce22ba9ddf4102d2e9ac3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Palmer?= Date: Wed, 18 Oct 2023 15:15:29 +0200 Subject: [PATCH] Tests: fix the slightly odd formatting on send_async_apdus --- tests/generate/gen_integration.ml | 8 ++++---- tests/integration/nano/test_reject_transaction.sh | 6 ++---- tests/integration/nano/test_sign_delegation.sh | 6 ++---- tests/integration/nano/test_sign_reveal.sh | 6 ++---- tests/integration/nano/test_sign_set_consensus_key.sh | 6 ++---- tests/integration/nano/test_sign_set_deposit_limit.sh | 6 ++---- tests/integration/nano/test_sign_transaction.sh | 6 ++---- tests/integration/nanos/regression_batched_ops.sh | 9 +++------ .../regression_press_right_works_across_apdu_recieves.sh | 9 +++------ 9 files changed, 22 insertions(+), 40 deletions(-) diff --git a/tests/generate/gen_integration.ml b/tests/generate/gen_integration.ml index 6d6c80fc6..3fa72c50f 100644 --- a/tests/generate/gen_integration.ml +++ b/tests/generate/gen_integration.ml @@ -53,19 +53,19 @@ let send_apdu ppf packet = Format.fprintf ppf "send_apdu %a@." pp_hex_bytes packet let expect_apdu_return ppf ans = - Format.fprintf ppf "expect_apdu_return %a@." pp_hex_bytes ans + Format.fprintf ppf "expect_apdu_return %a" pp_hex_bytes ans type async_apdu = { packet : bytes; check : Format.formatter -> unit -> unit } let send_async_apdus ppf async_apdus = - let pp_dash_break_line ppf () = Format.fprintf ppf "\\@\n\t" in + let pp_dash_break_line ppf () = Format.fprintf ppf " \\@\n\t" in let pp_async_apdu ppf { packet; check } = Format.fprintf ppf "%a \"%a\"" pp_hex_bytes packet check () in let pp_async_apdus = Format.pp_print_list ~pp_sep:pp_dash_break_line pp_async_apdu in - Format.fprintf ppf "send_async_apdus %a%a@." pp_dash_break_line () + Format.fprintf ppf "send_async_apdus%a%a@." pp_dash_break_line () pp_async_apdus async_apdus let expect_async_apdus_sent ppf () = @@ -76,7 +76,7 @@ let expect_exited ppf () = Format.fprintf ppf "expect_exited@." let quit_app ppf () = Format.fprintf ppf "quit_app@." let check_tlv_signature ppf ~prefix ~suffix pk message = - Format.fprintf ppf "check_tlv_signature %a %a %a %a@." pp_hex_bytes prefix + Format.fprintf ppf "check_tlv_signature %a %a %a %a" pp_hex_bytes prefix pp_hex_bytes suffix Tezos_crypto.Signature.Public_key.pp pk pp_hex_bytes message diff --git a/tests/integration/nano/test_reject_transaction.sh b/tests/integration/nano/test_reject_transaction.sh index 4778ac0af..4c40fc172 100644 --- a/tests/integration/nano/test_reject_transaction.sh +++ b/tests/integration/nano/test_reject_transaction.sh @@ -5,10 +5,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316 "expect_apdu_return $ERR_REJECT -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316 "expect_apdu_return $ERR_REJECT" expect_section_content 'Operation (0)' 'Transaction' press_button right expect_section_content 'Fee' '0.05 tz' diff --git a/tests/integration/nano/test_sign_delegation.sh b/tests/integration/nano/test_sign_delegation.sh index 4140fcfc8..c4c319e22 100644 --- a/tests/integration/nano/test_sign_delegation.sh +++ b/tests/integration/nano/test_sign_delegation.sh @@ -3,10 +3,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f8100550300000000000000000000000000000000000000000000000000000000000000006e01774d99da021b92d8c3dfc2e814c7658440319be2c09a0cf40509f906ff00591e842444265757d6a65e3670ca18b5e662f9c0 "expect_apdu_return a6b0ce461c2c49d22cc9ec552e2cec1f5648c724012d53384f07a5134366dcc0be83b0502234bb618de1b8e5585c3344332284858cc799f3e2f58820ba2e6f66c2403d3084b0ab6ae6400733a912448e7614fbab139b532f081da7bcf12f5b029000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f8100550300000000000000000000000000000000000000000000000000000000000000006e01774d99da021b92d8c3dfc2e814c7658440319be2c09a0cf40509f906ff00591e842444265757d6a65e3670ca18b5e662f9c0 "expect_apdu_return a6b0ce461c2c49d22cc9ec552e2cec1f5648c724012d53384f07a5134366dcc0be83b0502234bb618de1b8e5585c3344332284858cc799f3e2f58820ba2e6f66c2403d3084b0ab6ae6400733a912448e7614fbab139b532f081da7bcf12f5b029000" expect_section_content 'Operation (0)' 'Delegation' press_button right expect_section_content 'Fee' '0.2 tz' diff --git a/tests/integration/nano/test_sign_reveal.sh b/tests/integration/nano/test_sign_reveal.sh index ec794ac22..9cb488c85 100644 --- a/tests/integration/nano/test_sign_reveal.sh +++ b/tests/integration/nano/test_sign_reveal.sh @@ -3,10 +3,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f81005d0300000000000000000000000000000000000000000000000000000000000000006b00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e02030400747884d9abdf16b3ab745158925f567e222f71225501826fa83347f6cbe9c393 "expect_apdu_return 28a91fe25dca9feed9a746d2825f113b0b7c0c534853d4d9e8d37f3a29119a3edc717466cf0fb90cd9ea8fcaf5252a52ae865901d28f54128498a94588530a48eb56c343497ff3f69a671f97b4a5e4dec0f7afb443f6658f62610287c829b6089000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f81005d0300000000000000000000000000000000000000000000000000000000000000006b00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e02030400747884d9abdf16b3ab745158925f567e222f71225501826fa83347f6cbe9c393 "expect_apdu_return 28a91fe25dca9feed9a746d2825f113b0b7c0c534853d4d9e8d37f3a29119a3edc717466cf0fb90cd9ea8fcaf5252a52ae865901d28f54128498a94588530a48eb56c343497ff3f69a671f97b4a5e4dec0f7afb443f6658f62610287c829b6089000" expect_section_content 'Operation (0)' 'Reveal' press_button right expect_section_content 'Fee' '0.01 tz' diff --git a/tests/integration/nano/test_sign_set_consensus_key.sh b/tests/integration/nano/test_sign_set_consensus_key.sh index 7886e1ee9..aeb675d4b 100644 --- a/tests/integration/nano/test_sign_set_consensus_key.sh +++ b/tests/integration/nano/test_sign_set_consensus_key.sh @@ -3,10 +3,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f81005d0300000000000000000000000000000000000000000000000000000000000000007200c921d4487c90b4472da6cc566a58d79f0d991dbf904e02030400747884d9abdf16b3ab745158925f567e222f71225501826fa83347f6cbe9c393 "expect_apdu_return f9570b3272e25bc3a9c17a489547dcae70ae750adaa73b4b8eb5dd0b55be5987dd9c53607303e7c5f9c11488d5c8977d79e248f59f753eabf5ab7babfa61b1f6279b2e16dacb6db87e4e05cbdc23156d3e95989161d322ba2feb369beeb7b5049000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f81005d0300000000000000000000000000000000000000000000000000000000000000007200c921d4487c90b4472da6cc566a58d79f0d991dbf904e02030400747884d9abdf16b3ab745158925f567e222f71225501826fa83347f6cbe9c393 "expect_apdu_return f9570b3272e25bc3a9c17a489547dcae70ae750adaa73b4b8eb5dd0b55be5987dd9c53607303e7c5f9c11488d5c8977d79e248f59f753eabf5ab7babfa61b1f6279b2e16dacb6db87e4e05cbdc23156d3e95989161d322ba2feb369beeb7b5049000" expect_section_content 'Operation (0)' 'Set consensus key' press_button right expect_section_content 'Fee' '0.01 tz' diff --git a/tests/integration/nano/test_sign_set_deposit_limit.sh b/tests/integration/nano/test_sign_set_deposit_limit.sh index 8eeeb5c00..d8897d7eb 100644 --- a/tests/integration/nano/test_sign_set_deposit_limit.sh +++ b/tests/integration/nano/test_sign_set_deposit_limit.sh @@ -3,10 +3,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f81004203000000000000000000000000000000000000000000000000000000000000000070027c252d3806e6519ed064026bdb98edf866117331e0d40304f80204ffa09c01 "expect_apdu_return 8b4456454de1b3c41f5ea45e711893df26fabe9427048b95fda4276d5cf76ff6069c2cd9fe167a52cc21611a0f59465784f4fce94211aab9fee6309c8e8bf5cbcf1a3e3102d0825b5acaf341656b1c2078850f7d3a6749cc47f74688fbe2c30e9000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f81004203000000000000000000000000000000000000000000000000000000000000000070027c252d3806e6519ed064026bdb98edf866117331e0d40304f80204ffa09c01 "expect_apdu_return 8b4456454de1b3c41f5ea45e711893df26fabe9427048b95fda4276d5cf76ff6069c2cd9fe167a52cc21611a0f59465784f4fce94211aab9fee6309c8e8bf5cbcf1a3e3102d0825b5acaf341656b1c2078850f7d3a6749cc47f74688fbe2c30e9000" expect_section_content 'Operation (0)' 'Set deposit limit' press_button right expect_section_content 'Fee' '0.06 tz' diff --git a/tests/integration/nano/test_sign_transaction.sh b/tests/integration/nano/test_sign_transaction.sh index 59ba1d8a5..54c4bdc5d 100644 --- a/tests/integration/nano/test_sign_transaction.sh +++ b/tests/integration/nano/test_sign_transaction.sh @@ -5,10 +5,8 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316 "expect_apdu_return f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316 "expect_apdu_return f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000" expect_section_content 'Operation (0)' 'Transaction' press_button right expect_section_content 'Fee' '0.05 tz' diff --git a/tests/integration/nanos/regression_batched_ops.sh b/tests/integration/nanos/regression_batched_ops.sh index 653e45de0..cda240146 100644 --- a/tests/integration/nanos/regression_batched_ops.sh +++ b/tests/integration/nanos/regression_batched_ops.sh @@ -5,12 +5,9 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f0100eb0300000000000000000000000000000000000000000000000000000000000000006c001597c45b11b421bb806a0c56c5da5638bf4b1adbf0e617090006a09c010000bac799dfc7f6af2ff0b95f83d023e68c895020baffff086a65616e5f626f620000009a020000009507070200000000050800c6bab5ccc8d891cd8de4b6f7070707020000004b0704030b070702000000040505030b070705050a0000001503f01167865dc63dfee0e31251329ceab660d9460607070a000000150107b21fca96c5763f67b286752c7aaefc5931d15a030b050800a9df9fc1e7eaa7a9c1f7bd87a9ba9cadf5b5b2cd82 "expect_apdu_return 9000 -"\ - 800f82004a9deea2b7fef9070707020000000005050509030b6c01ee572f02e5be5d097ba17369789582882e8abb8790d627063202e0d403012b704944f5b5fd30eed2ab4385478488e09fe04a0000 "expect_apdu_return e3d5453110fb40a802b56b4af7f0d5370769b8154b0e6447357cbc54cc319ed4ff0b5c23a1a4ce3846ea35c135a3a5a4b8d3125c83a72a16f7a4fc0ffdc2306fbaead5a3559bf5974801055f505376bcd9abbe9bfec3d80f00c7161db0280e089000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f0100eb0300000000000000000000000000000000000000000000000000000000000000006c001597c45b11b421bb806a0c56c5da5638bf4b1adbf0e617090006a09c010000bac799dfc7f6af2ff0b95f83d023e68c895020baffff086a65616e5f626f620000009a020000009507070200000000050800c6bab5ccc8d891cd8de4b6f7070707020000004b0704030b070702000000040505030b070705050a0000001503f01167865dc63dfee0e31251329ceab660d9460607070a000000150107b21fca96c5763f67b286752c7aaefc5931d15a030b050800a9df9fc1e7eaa7a9c1f7bd87a9ba9cadf5b5b2cd82 "expect_apdu_return 9000" \ + 800f82004a9deea2b7fef9070707020000000005050509030b6c01ee572f02e5be5d097ba17369789582882e8abb8790d627063202e0d403012b704944f5b5fd30eed2ab4385478488e09fe04a0000 "expect_apdu_return e3d5453110fb40a802b56b4af7f0d5370769b8154b0e6447357cbc54cc319ed4ff0b5c23a1a4ce3846ea35c135a3a5a4b8d3125c83a72a16f7a4fc0ffdc2306fbaead5a3559bf5974801055f505376bcd9abbe9bfec3d80f00c7161db0280e089000" expect_section_content 'Operation (0)' 'Transaction' press_button right expect_section_content 'Fee' '0.39 tz' diff --git a/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh b/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh index 333ff8d68..12e914ad6 100644 --- a/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh +++ b/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh @@ -4,12 +4,9 @@ start_speculos "$seed" expected_home send_async_apdus \ - 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000 -"\ - 800f0100eb050200000135072f02000000c502000000c0034c072c0200000040051f02000000390200000034052000010743036c030b07430359030a07430368010000001b3b4c5c533f70242d4671295644670a5d74650a6f3476305f3829220200000072020000006d052000020743036c030b07430359030307430368010000002b4c692d252a656446367e3f455b354b6d753f64797669774a5e32225c64244679513e3e213e4424672851670743036801000000202a54783c45605369473659662a415e6b5a5c3d373f485b6d4f6c510a5d4568730200000062072f020000000203210200000054020000004f05 "expect_apdu_return 9000 -"\ - 800f8200502000040743036c030b07430359030a074303680100000009225c365f340a246b25074303680100000024635e31225c3f45795f31214556627e393b45583b59550a234b6a325a54386860552158200345 "expect_apdu_return dcba96786c40c7894527a85050bc0b75eaee37aa020a52c634275450018da47822d552099146915f4c3280b3dbd4ab5d459b96b585247e58fda9bf53c9951dbe017811d074e688f11d8f47ce7f94c0548dca76be9ae9e87df794d3facdb4bb0a9000 -" + 800f000011048000002c800006c18000000080000000 "expect_apdu_return 9000" \ + 800f0100eb050200000135072f02000000c502000000c0034c072c0200000040051f02000000390200000034052000010743036c030b07430359030a07430368010000001b3b4c5c533f70242d4671295644670a5d74650a6f3476305f3829220200000072020000006d052000020743036c030b07430359030307430368010000002b4c692d252a656446367e3f455b354b6d753f64797669774a5e32225c64244679513e3e213e4424672851670743036801000000202a54783c45605369473659662a415e6b5a5c3d373f485b6d4f6c510a5d4568730200000062072f020000000203210200000054020000004f05 "expect_apdu_return 9000" \ + 800f8200502000040743036c030b07430359030a074303680100000009225c365f340a246b25074303680100000024635e31225c3f45795f31214556627e393b45583b59550a234b6a325a54386860552158200345 "expect_apdu_return dcba96786c40c7894527a85050bc0b75eaee37aa020a52c634275450018da47822d552099146915f4c3280b3dbd4ab5d459b96b585247e58fda9bf53c9951dbe017811d074e688f11d8f47ce7f94c0548dca76be9ae9e87df794d3facdb4bb0a9000" expect_section_content \ 'Expression' \