Skip to content

Commit

Permalink
Merge pull request #58 from blooo-io/feat/LDG-623--nano-app-implement…
Browse files Browse the repository at this point in the history
…-registerdata-stax-and-flex-di

feat: added display flex|stax for RegisterData
  • Loading branch information
n4l5u0r authored Dec 13, 2024
2 parents 7132787 + 1c5b56b commit dafa419
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 21 deletions.
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

0 comments on commit dafa419

Please sign in to comment.