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 RegisterData #58

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
57 changes: 53 additions & 4 deletions src/common/ui/display_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,15 +668,64 @@ void uiSignPublicInformationForIpPublicKeyDisplay(void) {
}

void uiRegisterDataInitialDisplay(volatile unsigned int *flags) {
return;
uint8_t pairIndex = 0;
pairs[pairIndex].item = "Sender";
pairs[pairIndex].value = (char *)global_account_sender.sender;
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_useCaseReviewLight(TYPE_OPERATION,
&content,
&C_app_concordium_64px,
"Review transaction",
NULL, // No subtitle
"Continue with transaction",
sendSuccessNoIdleCallback);
*flags |= IO_ASYNCH_REPLY;
// TODO: Implement this
}

void uiRegisterDataPayloadDisplay(volatile unsigned int *flags) {
return;
// Get context from global state
signRegisterData_t *ctx = &global.withDataBlob.signRegisterData;

uint8_t index = 0;
pairs[index].item = "Data";
pairs[index].value = (char *)global.withDataBlob.cborContext.display;
index++;
// Create the page content
nbgl_contentTagValueList_t content;
content.nbPairs = index;
content.pairs = pairs;
content.smallCaseForValue = false;
content.nbMaxLinesForValue = 0;
content.startIndex = 0;

if (ctx->dataLength > 0) {
// Setup the review screen
nbgl_useCaseReviewLight(TYPE_OPERATION,
&content,
&C_app_concordium_64px,
"Review Data",
NULL, // No subtitle
"Continue with transaction",
sendSuccessNoIdleCallback);
} else {
nbgl_useCaseReview(TYPE_TRANSACTION,
&content,
&C_app_concordium_64px,
"Review Data",
NULL, // No subtitle
"Sign transaction",
review_choice_sign);
}

*flags |= IO_ASYNCH_REPLY;
// TODO: Implement this
}

void startTransferDisplay(bool displayMemo, volatile unsigned int *flags) {
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.
57 changes: 40 additions & 17 deletions tests/test_register_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,52 @@ def test_register_data(
header_and_type=header_and_type,
data_length=len(data),
):
navigator.navigate_and_compare(
default_screenshot_path,
test_name,
instructions_builder(3, backend),
10,
True,
False,
)
if firmware.is_nano:
navigator.navigate_and_compare(
default_screenshot_path,
test_name,
instructions_builder(3, backend),
10,
True,
False,
)
else:
navigate_until_text_and_compare(
firmware,
navigator,
"Continue",
default_screenshot_path,
test_name + "_1",
True,
False,
NavInsID.USE_CASE_CHOICE_CONFIRM,
)
response = client.get_async_response()
print(response.data.hex())
assert response.status == 0x9000
screenshots_so_far = 4
# Send the second part of the data
with client.register_data_part_2(data):
navigator.navigate_and_compare(
default_screenshot_path,
test_name,
instructions_builder(1, backend) + [NavInsID.BOTH_CLICK],
10,
False,
True,
screenshots_so_far,
)
if firmware.is_nano:
navigator.navigate_and_compare(
default_screenshot_path,
test_name,
instructions_builder(1, backend) + [NavInsID.BOTH_CLICK],
10,
False,
True,
screenshots_so_far,
)
else:
navigate_until_text_and_compare(
firmware,
navigator,
"Sign transaction",
default_screenshot_path,
test_name + "_2",
True,
False,
)
response = client.get_async_response()
print(response.data.hex())
assert response.status == 0x9000
Expand Down
Loading