diff --git a/.gitignore b/.gitignore index 704e84a2..ba0b851f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ bin debug build src/delegates.h - +env #ide *.code-workspace compile_commands.json diff --git a/Makefile b/Makefile index 23fb9230..b5fcc245 100644 --- a/Makefile +++ b/Makefile @@ -100,8 +100,6 @@ endif DEBUG ?= 0 ifneq ($(DEBUG),0) - DEFINES += TEZOS_DEBUG - ifeq ($(TARGET_NAME),TARGET_NANOS) DEFINES += HAVE_PRINTF PRINTF=screen_printf else diff --git a/src/operations.c b/src/operations.c index d6abe364..5897c421 100644 --- a/src/operations.c +++ b/src/operations.c @@ -13,21 +13,12 @@ #define STEP_HARD_FAIL -2 // Argument is to distinguish between different parse errors for debugging purposes only -__attribute__((noreturn)) static void parse_error( -#ifndef TEZOS_DEBUG - __attribute__((unused)) -#endif - uint32_t lineno) { - +__attribute__((noreturn)) static void parse_error(void) { global.apdu.u.sign.parse_state.op_step = STEP_HARD_FAIL; -#ifdef TEZOS_DEBUG - THROW(0x9000 + lineno); -#else THROW(EXC_PARSE_ERROR); -#endif } -#define PARSE_ERROR() parse_error(__LINE__) +#define PARSE_ERROR() parse_error() // Conversion/check functions diff --git a/test/python/requirements.txt b/test/python/requirements.txt index b60e4153..5841c6a6 100644 --- a/test/python/requirements.txt +++ b/test/python/requirements.txt @@ -1,5 +1,5 @@ base58 bip32 GitPython -pytezos==3.10.2 +pytezos ragger[tests,speculos] diff --git a/test/python/snapshots/stax/test_authorize_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png b/test/python/snapshots/stax/test_authorize_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_authorize_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png and b/test/python/snapshots/stax/test_authorize_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png differ diff --git a/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png b/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png and b/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png differ diff --git a/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png b/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png and b/test/python/snapshots/stax/test_authorize_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png differ diff --git a/test/python/snapshots/stax/test_authorize_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png b/test/python/snapshots/stax/test_authorize_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_authorize_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png and b/test/python/snapshots/stax/test_authorize_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png differ diff --git a/test/python/snapshots/stax/test_authorize_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png b/test/python/snapshots/stax/test_authorize_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_authorize_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png and b/test/python/snapshots/stax/test_authorize_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png b/test/python/snapshots/stax/test_get_public_key_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png and b/test/python/snapshots/stax/test_get_public_key_baking/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png b/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png and b/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png b/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png and b/test/python/snapshots/stax/test_get_public_key_baking/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png b/test/python/snapshots/stax/test_get_public_key_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png and b/test/python/snapshots/stax/test_get_public_key_baking/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png b/test/python/snapshots/stax/test_get_public_key_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png and b/test/python/snapshots/stax/test_get_public_key_baking/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_prompt/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png b/test/python/snapshots/stax/test_get_public_key_prompt/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_prompt/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png and b/test/python/snapshots/stax/test_get_public_key_prompt/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png b/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png and b/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png b/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png and b/test/python/snapshots/stax/test_get_public_key_prompt/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_prompt/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png b/test/python/snapshots/stax/test_get_public_key_prompt/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_prompt/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png and b/test/python/snapshots/stax/test_get_public_key_prompt/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png differ diff --git a/test/python/snapshots/stax/test_get_public_key_prompt/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png b/test/python/snapshots/stax/test_get_public_key_prompt/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png index f59899e9..13499fcc 100644 Binary files a/test/python/snapshots/stax/test_get_public_key_prompt/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png and b/test/python/snapshots/stax/test_get_public_key_prompt/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png differ diff --git a/test/python/snapshots/stax/test_reset_app_context/00003.png b/test/python/snapshots/stax/test_reset_app_context/00003.png index 04c665a8..3fcc957d 100644 Binary files a/test/python/snapshots/stax/test_reset_app_context/00003.png and b/test/python/snapshots/stax/test_reset_app_context/00003.png differ diff --git a/test/python/snapshots/stax/test_setup_app_context/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png b/test/python/snapshots/stax/test_setup_app_context/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png index 38cac4de..7a410fc9 100644 Binary files a/test/python/snapshots/stax/test_setup_app_context/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png and b/test/python/snapshots/stax/test_setup_app_context/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png differ diff --git a/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png b/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png index 38cac4de..7a410fc9 100644 Binary files a/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png and b/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png differ diff --git a/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png b/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png index 38cac4de..7a410fc9 100644 Binary files a/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png and b/test/python/snapshots/stax/test_setup_app_context/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00004.png differ diff --git a/test/python/snapshots/stax/test_setup_app_context/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png b/test/python/snapshots/stax/test_setup_app_context/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png index 38cac4de..7a410fc9 100644 Binary files a/test/python/snapshots/stax/test_setup_app_context/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png and b/test/python/snapshots/stax/test_setup_app_context/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00004.png differ diff --git a/test/python/snapshots/stax/test_setup_app_context/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png b/test/python/snapshots/stax/test_setup_app_context/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png index 38cac4de..7a410fc9 100644 Binary files a/test/python/snapshots/stax/test_setup_app_context/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png and b/test/python/snapshots/stax/test_setup_app_context/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00004.png differ diff --git a/test/python/snapshots/stax/test_sign_delegation/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png b/test/python/snapshots/stax/test_sign_delegation/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png index b2b4f389..732d0574 100644 Binary files a/test/python/snapshots/stax/test_sign_delegation/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png and b/test/python/snapshots/stax/test_sign_delegation/BIP32_ED25519_tz1VKyZ3RFDwTkrz5LKcTc6fcYqZj6pvsyA7/00003.png differ diff --git a/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png b/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png index b2b4f389..732d0574 100644 Binary files a/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png and b/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1dyX3B1CFYa2DfdFLyPtiJCfQRUgPVME6E/00003.png differ diff --git a/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00003.png b/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00003.png index b2b4f389..732d0574 100644 Binary files a/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00003.png and b/test/python/snapshots/stax/test_sign_delegation/ED25519_tz1ez9eEyAxuDZACjHdCXym43UQDdMNa3LEL/00003.png differ diff --git a/test/python/snapshots/stax/test_sign_delegation/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00003.png b/test/python/snapshots/stax/test_sign_delegation/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00003.png index b2b4f389..732d0574 100644 Binary files a/test/python/snapshots/stax/test_sign_delegation/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00003.png and b/test/python/snapshots/stax/test_sign_delegation/SECP256K1_tz2GB5YHqF4UzQ8GP5yUqdhY9oVWRXCY2hPU/00003.png differ diff --git a/test/python/snapshots/stax/test_sign_delegation/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00003.png b/test/python/snapshots/stax/test_sign_delegation/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00003.png index b2b4f389..732d0574 100644 Binary files a/test/python/snapshots/stax/test_sign_delegation/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00003.png and b/test/python/snapshots/stax/test_sign_delegation/SECP256R1_tz3UMNyvQeMj6mQSftW2aV2XaWd3afTAM1d5/00003.png differ