EIP712 code now uses the global apdu response code; error handling improvements

This commit is contained in:
Alexandre Paillier
2022-07-19 11:04:16 +02:00
parent 12b97d91db
commit 0100eed1fd
9 changed files with 207 additions and 127 deletions

View File

@@ -16,6 +16,7 @@
#include "context.h" // eip712_context_deinit
#include "uint256.h" // tostring256 && tostring256_signed
#include "path.h" // path_get_root_type
#include "apdu_constants.h" // APDU response codes
static t_ui_context *ui_ctx = NULL;
@@ -359,6 +360,10 @@ bool ui_712_init(void)
ui_ctx->pos = UI_712_POS_REVIEW;
ui_ctx->filtering_mode = EIP712_FILTERING_BASIC;
}
else
{
apdu_response_code = APDU_RESPONSE_INSUFFICIENT_MEMORY;
}
return ui_ctx != NULL;
}