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

Factor out UI modules unlock and pin #97

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

italo-sampaio
Copy link
Collaborator

  • Factor out unlock and pin modules
  • Add unit tests for unlock and pin

- Factor out unlock and pin modules
- Add unit tests for unlock and pin
@italo-sampaio italo-sampaio marked this pull request as draft October 24, 2022 19:44
@italo-sampaio italo-sampaio marked this pull request as ready for review October 24, 2022 20:00
Copy link
Collaborator

@amendelzon amendelzon left a comment

Choose a reason for hiding this comment

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

Implementation looking good so far! I've added a few comments with things I think we can improve. The one we probably need to address for sure is the pin buffer duplication. Let me know your thoughts!

ledger/src/ui/src/pin.c Outdated Show resolved Hide resolved
ledger/src/ui/src/pin.h Outdated Show resolved Hide resolved
ledger/src/ui/src/bolos_ux.c Outdated Show resolved Hide resolved
ledger/src/ui/src/pin.h Outdated Show resolved Hide resolved
ledger/src/ui/src/unlock.h Outdated Show resolved Hide resolved
ledger/src/ui/test/pin/test_pin.c Outdated Show resolved Hide resolved
ledger/src/ui/test/mock/os.h Show resolved Hide resolved
- Changed pin context to hold just a pointer to the pin buffer
- Changed function names to more declarative versions
- Removed unused pin length macros
- Added missing comments
- Refactored pin and unlock unit tests for clarity
Copy link
Collaborator

@amendelzon amendelzon left a comment

Choose a reason for hiding this comment

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

LGTM. Apart from a variable that we probably don't need, very minor suggestions. Please take a look and let me know your thoughts. Thanks!

ledger/src/ui/src/bolos_ux.c Outdated Show resolved Hide resolved
ledger/src/ui/src/bolos_ux.c Outdated Show resolved Hide resolved
ledger/src/ui/src/bolos_ux.h Outdated Show resolved Hide resolved
ledger/src/ui/src/pin.h Outdated Show resolved Hide resolved
ledger/src/ui/test/mock/os.h Show resolved Hide resolved
ledger/src/ui/test/pin/test_pin.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@amendelzon amendelzon left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for tackling this!

@amendelzon amendelzon merged commit 43b457d into master Oct 27, 2022
@amendelzon amendelzon deleted the enhancement/103-add-ui-unlock-unit-tests branch October 27, 2022 19:04
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.

2 participants