diff --git a/lib_standard_app/main.c b/lib_standard_app/main.c index fc0b0fbb5..702bfe93a 100644 --- a/lib_standard_app/main.c +++ b/lib_standard_app/main.c @@ -149,7 +149,7 @@ WEAK void library_app_main(libargs_t *args) } FINALLY { - os_lib_end(); + swap_finalize_exchange_sign_transaction(LAST_CYCLE_EXCEPTION); } } END_TRY; diff --git a/lib_standard_app/swap_entrypoints.h b/lib_standard_app/swap_entrypoints.h index 919b8d387..aa0632808 100644 --- a/lib_standard_app/swap_entrypoints.h +++ b/lib_standard_app/swap_entrypoints.h @@ -41,7 +41,15 @@ void swap_handle_get_printable_amount(get_printable_amount_parameters_t *params) * return false on error, true otherwise */ bool swap_copy_transaction_parameters(create_transaction_parameters_t *sign_transaction_params); + +// Boolean like status + a special value +typedef enum last_cycle_status_e { + LAST_CYCLE_ERROR = 0, + LAST_CYCLE_SUCCESS = 1, + LAST_CYCLE_EXCEPTION = 2, +} last_cycle_status_t; + /* Set create_transaction.result and call os_lib_end(). * * Doesn't return */ -void __attribute__((noreturn)) swap_finalize_exchange_sign_transaction(bool is_success); +void __attribute__((noreturn)) swap_finalize_exchange_sign_transaction(last_cycle_status_t is_success);