Skip to content

Commit

Permalink
Report exception to exchange in swap mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Dec 6, 2024
1 parent e8f68a6 commit 917c28f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib_standard_app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion lib_standard_app/swap_entrypoints.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 917c28f

Please sign in to comment.