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

POC of wrapped + sync transaction review #111

Closed
wants to merge 8 commits into from

Conversation

xchapron-ledger
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7d1c3c3) 83.01% compared to head (27d7f03) 83.01%.

❗ Current head 27d7f03 differs from pull request most recent head e671ce6. Consider uploading reports for the commit e671ce6 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #111   +/-   ##
=======================================
  Coverage   83.01%   83.01%           
=======================================
  Files           3        3           
  Lines          53       53           
=======================================
  Hits           44       44           
  Misses          9        9           
Flag Coverage Δ
unittests 83.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xchapron-ledger xchapron-ledger force-pushed the xch/nbgl-sync branch 2 times, most recently from 27d7f03 to f165504 Compare January 29, 2024 17:53
Comment on lines +41 to +43
if (apdu_state == APDU_IDLE && G_io_app.apdu_state != APDU_IDLE) {
return NBGL_SYNC_RET_RX_APDU;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure to understand the need to end the loop in this case.
New APDU should be ignored because a transaction is already being processed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a proposal to interrupt sync nbgl calls like nbgl_useCaseStatus, or nbgl_useCaseHome during which there is no transaction being processed.
But this might indeed disappear as we might want to respond to the APDU only after the timeout of nbgl_useCaseStatus and I'm not sure we will make a sync version of nbgl_useCaseHome

bool wrapping)
{
uint16_t textLen = strlen(text);
const char *origText = text;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable origText is not used.
uint16_t nbLines = 0;

while (textLen) {
uint8_t char_width;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable char_width is not used.
}

// This function is used to retrieve the width of a line of text.
static uint32_t se_compute_line_width_light(const char *text,

Check notice

Code scanning / CodeQL

Unused static function Note

Static function se_compute_line_width_light is unreachable
#ifdef HAVE_BAGL
void io_seproxyhal_display(const bagl_element_t *element)
{
io_seproxyhal_display_default(element);

Check warning

Code scanning / CodeQL

Implicit function declaration Warning

Function call implicitly declares 'io_seproxyhal_display_default'.
}
#else
nbgl_buttonEvent_t event = maskToEvent(button_mask);
layout_buttonCallback(event);

Check warning

Code scanning / CodeQL

Implicit function declaration Warning

Function call implicitly declares 'layout_buttonCallback'.
memcpy(&context.review.tagValueList, tagValueList, sizeof(nbgl_layoutTagValueList_t));
}

context.review.address = address;

Check warning

Code scanning / CodeQL

Local variable address stored in non-local memory Warning

A stack address which arrived via a
parameter
may be assigned to a non-local variable.
sync_nbgl_ret_t sync_nbgl_useCaseStatus(const char *message, bool isSuccess)
{
sync_nbgl_init();
nbgl_useCaseStatus(message, isSuccess, quit_callback);

Check warning

Code scanning / CodeQL

Call to a function with one or more incompatible arguments Warning

Calling
nbgl_useCaseStatus
: argument
isSuccess
of type
bool
is incompatible with parameter
bool isSuccess
.
// the screen, and therefore the modal will be dismissed and its callback
// will never be called.
if (ret == UI_RET_APPROVED) {
nbgl_useCaseStatus("ADDRESS\nVERIFIED", true, ui_menu_main);

Check warning

Code scanning / CodeQL

Call to a function with one or more incompatible arguments Warning

Calling
nbgl_useCaseStatus
: argument
1
of type
int
is incompatible with parameter
bool isSuccess
.
if (ret == UI_RET_APPROVED) {
nbgl_useCaseStatus("ADDRESS\nVERIFIED", true, ui_menu_main);
} else if (ret == UI_RET_REJECTED) {
nbgl_useCaseStatus("Address verification\ncancelled", false, ui_menu_main);

Check warning

Code scanning / CodeQL

Call to a function with one or more incompatible arguments Warning

Calling
nbgl_useCaseStatus
: argument
0
of type
int
is incompatible with parameter
bool isSuccess
.
} else if (ret == UI_RET_REJECTED) {
nbgl_useCaseStatus("Address verification\ncancelled", false, ui_menu_main);
} else {
nbgl_useCaseStatus("Address verification\nissue", false, ui_menu_main);

Check warning

Code scanning / CodeQL

Call to a function with one or more incompatible arguments Warning

Calling
nbgl_useCaseStatus
: argument
0
of type
int
is incompatible with parameter
bool isSuccess
.
@xchapron-ledger
Copy link
Contributor Author

Replaced by #120

@xchapron-ledger xchapron-ledger deleted the xch/nbgl-sync branch May 2, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants