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

Keystone integration #1692

Merged
merged 11 commits into from
Dec 2, 2024
Merged

Keystone integration #1692

merged 11 commits into from
Dec 2, 2024

Conversation

Milan-Cerovsky
Copy link
Contributor

@Milan-Cerovsky Milan-Cerovsky commented Nov 22, 2024

Author

  • Self-review your own code in GitHub's web interface1
  • Add automated tests as appropriate
  • Update the manual tests2 as appropriate
  • Check the code coverage3 report for the automated tests
  • Update documentation as appropriate (e.g README.md, Architecture.md, CHANGELOG.md, etc.)
  • Run the app and try the changes
  • Pull in the latest changes from the main branch and squash your commits before assigning a reviewer4

Note
It is good practice to provide before and after UI screenshots in the description of this PR. This is only applicable for changes that modify the UI.

Reviewer

  • Check the code with the Code Review Guidelines checklist
  • Perform an ad hoc review5
  • Review the automated tests
  • Review the manual tests
  • Review the documentation, README.md, Architecture.md, etc. as appropriate
  • Run the app and try the changes6

Footnotes

  1. Code often looks different when reviewing the diff in a browser, making it easier to spot potential bugs.

  2. While we aim for automated testing of the application, some aspects require manual testing. If you had to manually test something during development of this pull request, write those steps down.

  3. While we are not looking for perfect coverage, the tool can point out potential cases that have been missed. Code coverage can be generated with: ./gradlew check for Kotlin modules and ./gradlew connectedCheck -PIS_ANDROID_INSTRUMENTATION_TEST_COVERAGE_ENABLED=true for Android modules.

  4. Having your code up to date and squashed will make it easier for others to review. Use best judgement when squashing commits, as some changes (such as refactoring) might be easier to review as a separate commit.

  5. In addition to a first pass using the code review guidelines, do a second pass using your best judgement and experience which may identify additional questions or comments. Research shows that code review is most effective when done in multiple passes, where reviewers look for different things through each pass.

  6. While the CI server runs the app to look for build failures or crashes, humans running the app are more likely to notice unexpected log messages, UI inconsistencies, or bad output data. Perform this step last, after verifying the code changes are safe to run locally.

@Milan-Cerovsky Milan-Cerovsky self-assigned this Nov 22, 2024
Copy link
Collaborator

@HonzaR HonzaR left a comment

Choose a reason for hiding this comment

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

@Milan-Cerovsky please, we need to fix the broken tests first.

Copy link
Collaborator

@HonzaR HonzaR left a comment

Choose a reason for hiding this comment

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

I left a few comments inline. Please create separate strings folders and move related texts into them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use vector instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does not export well into a vector :(

Column {
Text(
modifier = Modifier.padding(horizontal = 24.dp),
text = "Wallets & Hardware",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move all texts into the related strings.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isLoading = isLoading,
addWalletButton =
ButtonState(
text = stringRes("Add hardware wallet")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment here.

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 button will be removed with upcoming PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hardcoded texts here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

) {
Image(
bitmap = it,
contentDescription = "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use null instead of empty string for content descriptions that we want to omit from talkback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it to null

}.stateIn(viewModelScope, SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT), null)

@Suppress("MaxLineLength", "MagicNumber")
private fun genSolanaQRCode(): UREncoder {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move this sample code to a fixture instead of the production part so we can easily replace it later.

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 is refactored in the next coming PR

var failureText: String? = null

if (validationResult == ScanValidationState.INVALID) {
failureText = "This QR code is not a valid Keystone wallet."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hardcoded text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Text(
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
text = "Scan your Keystone wallet to connect",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hardcoded text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if (null == collectedCameraProvider) {
// Show loading indicator
} else {
val contentDescription = stringResource(id = R.string.scan_preview_content_description)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add e.g. scan_keystone resource folder and separate these strings into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Milan-Cerovsky Milan-Cerovsky requested a review from HonzaR December 2, 2024 09:01
@Milan-Cerovsky Milan-Cerovsky merged commit d4805ca into feature/keystone Dec 2, 2024
15 checks passed
@Milan-Cerovsky Milan-Cerovsky deleted the keystone-integration branch December 2, 2024 09:51
Milan-Cerovsky added a commit that referenced this pull request Dec 17, 2024
* Keystone integration (#1692)

* Keystone QR generation and reader

* Keystone account list UI

* Top app bar refactor

* Code cleanup

* Design update

* Keystone version bump

* Code cleanup

* Test hotfixes

* Code cleanup

* Keystone business logic implementation & ui elaboration (#1708)

* Keystone business logic implementation & ui elaboration

* Code cleanup

* Code cleanup

* Strings code cleanup

* Navigation refactor

* Navigation update

* Select keystone account button hotfix

* Navigation hotfix

* Wallet restoration hotfixes and optimizations

* Confirmation refactor

* Design updates

* Strings update and design updates

* Zip321 keystone integration

* Strings update

* Spanish translations

* New SDK changes integration

* New SDK version adoption

* Code cleanup

* Code cleanup

* Transaction history preparation

* Sapling address made optional

* Code cleanup

* Design updates

* Transaction hotfix

* PCZT preparation

* Settings design update

* Strings update

* Code cleanup

* PCZT integration

* Design updates

* Code cleanup

* App hotfixes

* Strings update

* Strings update

* Transparent transaction UI update

* Keystone tutorial link commented out

* Keystone exception handling

* Scan keystone progress bar

* Scan keystone performance update

* Share PCZT debug button

* Optimizations

* Add `MockSynchornizer` functions

* Try-catch address obtaining

Even though this is not the proper way we want to implement it, it fixes #1658 as a temporary solution

* Fix `ExchangeRateState` loading state

* Peformance optimizations

* Account data source exception handling

* Spanish strings updated

* Transaction progress texts updated

* Copy PCZT proposal data

* Dialog window dim fix

* Proposal proof optimization

* Proposal proof optimization

* Transaction progress shielding texts update

* Code cleanup

* Code cleanup

* Code cleanup

* PCZT progress calculation update

* KS promo

* KS sign in progress update

* KS QR progress update

* Adopt `Synchronizer.Status.INITIALIZING` state

* Design updates

* Propagate exceptions

* Updates

* Code cleanup

* Promo update

* Scan fix

* Code cleanup

* Bump to Zcash SDK 2.2.7-SNAPSHOT

* Fix lint warnings

* Make tests update

With follow-up #1713 for fixing the failing tests.

---------

Co-authored-by: Honza <[email protected]>

---------

Co-authored-by: Honza <[email protected]>
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