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

feat: added display flex|stax for ExportPrivateKey #53

Merged
Merged
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
33 changes: 32 additions & 1 deletion src/common/ui/display_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ static void review_choice(bool confirm) {
nbgl_useCaseReviewStatus(STATUS_TYPE_ADDRESS_REJECTED, ui_menu_main);
}
}

static void review_export_private_key(bool confirm) {
// Answer, display a status page and go back to main
if (confirm) {
exportPrivateKey();
} else {
sendUserRejection();
}
}

static void review_choice_sign(bool confirm) {
// Answer, display a status page and go back to main
if (confirm) {
Expand Down Expand Up @@ -55,8 +65,29 @@ void uiGeneratePubkey(volatile unsigned int *flags) {
}

void uiExportPrivateKey(volatile unsigned int *flags) {
// Create tag-value pairs for the content
uint8_t pairIndex = 0;
pairs[pairIndex].item = (char *) global.exportPrivateKeyContext.displayHeader;
pairs[pairIndex].value = (char *) global.exportPrivateKeyContext.display;
pairIndex++;

// Create the page content
nbgl_contentTagValueList_t content;
content.nbPairs = pairIndex;
content.pairs = pairs;
content.smallCaseForValue = false;
content.nbMaxLinesForValue = 0;
content.startIndex = 0;

// Setup the review screen
nbgl_useCaseReview(TYPE_OPERATION,
&content,
&C_app_concordium_64px,
"Export Private Key",
NULL,
"Accept",
review_export_private_key);
*flags |= IO_ASYNCH_REPLY;
// TODO: Implement this
}

void startConfigureBakerCommissionDisplay(void) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tests/test_export_private_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_export_standard_private_key_legacy_path(
"Accept",
default_screenshot_path,
test_name,
screen_change_before_first_instruction=False,
screen_change_before_first_instruction=True,
screen_change_after_last_instruction=True,
)
result = client.get_async_response()
Expand All @@ -48,7 +48,7 @@ def test_export_recovery_private_key_legacy_path(
"Accept",
default_screenshot_path,
test_name,
screen_change_before_first_instruction=False,
screen_change_before_first_instruction=True,
screen_change_after_last_instruction=True,
)
result = client.get_async_response()
Expand All @@ -72,7 +72,7 @@ def test_export_prfkey_and_idcredsed_private_key_legacy_path(
"Accept",
default_screenshot_path,
test_name,
screen_change_before_first_instruction=False,
screen_change_before_first_instruction=True,
screen_change_after_last_instruction=True,
)
result = client.get_async_response()
Expand All @@ -96,7 +96,7 @@ def test_export_standard_private_key_new_path(
"Accept",
default_screenshot_path,
test_name,
screen_change_before_first_instruction=False,
screen_change_before_first_instruction=True,
screen_change_after_last_instruction=True,
)
result = client.get_async_response()
Expand Down
Loading