Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report exception to exchange in swap mode #831

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions 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().
* parameter is a last_cycle_status_t
*
* Doesn't return */
void __attribute__((noreturn)) swap_finalize_exchange_sign_transaction(bool is_success);
Loading