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(wallet): Shield ZCash Account Modal #26214

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

Douglashdaniel
Copy link
Contributor

Description

Introduces the ability to Shield a ZCash Account on the Accounts page.

Resolves brave/brave-browser#41780

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  1. Make sure that ZCash Shielded Transactions` is enabled
  2. Open the Wallet and navigate to the Accounts tab
  3. Click on the More Menu for you ZCash Account
  4. Click on Switch to shielded account
  5. Now click Shield account
  6. If successful you should now see a Shielded label next to your Account Name.
Screen.Recording.5.mov

@Douglashdaniel Douglashdaniel self-assigned this Oct 24, 2024
@Douglashdaniel Douglashdaniel requested review from a team as code owners October 24, 2024 21:56
@github-actions github-actions bot added chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch CI/storybook-url Deploy storybook and provide a unique URL for each build feature/web3/wallet feature/web3/wallet/core puLL-Merge labels Oct 24, 2024
@Douglashdaniel Douglashdaniel force-pushed the feat-wallet-shield-zcash-account-modal branch from eaeae83 to 01c6c75 Compare October 24, 2024 21:59
@github-actions github-actions bot removed the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Oct 24, 2024
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Copy link
Collaborator

@cypt4 cypt4 left a comment

Choose a reason for hiding this comment

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

++

@@ -981,6 +981,7 @@ struct WalletInfo {
bool is_z_cash_enabled;
bool is_ankr_balances_feature_enabled;
bool is_transaction_simulations_feature_enabled;
bool is_z_cash_shielded_transactions_enabled;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: zcash

const canShieldAccount =
isZCashShieldedTransactionsEnabled &&
account.accountId.coin === BraveWallet.CoinType.ZEC &&
zCashAccountInfo &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is better to use zcash instead of zCash like in other places

Copy link
Member

@onyb onyb left a comment

Choose a reason for hiding this comment

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

++

Copy link
Contributor

@nuo-xu nuo-xu left a comment

Choose a reason for hiding this comment

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

iOS++

@Douglashdaniel Douglashdaniel force-pushed the feat-wallet-shield-zcash-account-modal branch from 01c6c75 to a78f2ad Compare October 29, 2024 23:34
@Douglashdaniel Douglashdaniel force-pushed the feat-wallet-shield-zcash-account-modal branch from a78f2ad to 61a3657 Compare October 30, 2024 14:38
Copy link
Contributor

[puLL-Merge] - brave/brave-core@26214

Description

This PR adds support for ZCash shielded transactions in the Brave Wallet. It introduces new UI elements and functionality to allow users to upgrade their ZCash accounts to shielded accounts, which provide enhanced privacy for transactions.

Changes

Changes

  1. browser/ui/webui/brave_wallet/common_handler/wallet_handler.cc:

    • Added IsZCashShieldedTransactionsEnabled() to the WalletInfo struct.
  2. components/brave_wallet/browser/brave_wallet_constants.h:

    • Added new localized strings for ZCash shielded transactions.
  3. components/brave_wallet/common/brave_wallet.mojom:

    • Added is_z_cash_shielded_transactions_enabled to the WalletInfo struct.
  4. components/brave_wallet_ui/common/selectors/wallet-selectors.ts:

    • Added a selector for isZCashShieldedTransactionsEnabled.
  5. components/brave_wallet_ui/common/slices/wallet.slice.ts:

    • Added isZCashShieldedTransactionsEnabled to the wallet state.
  6. components/brave_wallet_ui/components/desktop/account-list-item/index.tsx:

    • Updated to display a "Shielded" label for shielded ZCash accounts.
    • Added logic to show the shield account modal.
  7. components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/:

    • Added new components for the shield ZCash account modal.
  8. components/brave_wallet_ui/components/desktop/wallet-menus/account-actions-menu.tsx:

    • Added support for the "Shield" action in the account menu.
  9. components/brave_wallet_ui/constants/types.ts:

    • Added isZCashShieldedTransactionsEnabled to the WalletState interface.
    • Added shield to AccountModalTypes.
  10. components/brave_wallet_ui/options/account-list-button-options.ts:

    • Added a new option for shielding ZCash accounts.
  11. components/brave_wallet_ui/stories/locale.ts:

    • Added new localized strings for ZCash shielded transactions.
  12. components/resources/wallet_strings.grdp:

    • Added new string resources for ZCash shielded transactions.

Possible Issues

  • The PR doesn't include any tests for the new functionality, which could lead to potential bugs or regressions.
  • The implementation assumes that the backend support for ZCash shielded transactions is already in place, which may not be the case if this is part of a larger feature rollout.

Security Hotspots

No significant security hotspots were identified in this change. However, as this feature deals with privacy-enhancing functionality for cryptocurrency transactions, it's crucial that the implementation correctly handles the shielding process and doesn't inadvertently expose sensitive information.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

strings look good

@Douglashdaniel Douglashdaniel merged commit 62e8e1f into master Oct 30, 2024
17 checks passed
@Douglashdaniel Douglashdaniel deleted the feat-wallet-shield-zcash-account-modal branch October 30, 2024 22:18
@github-actions github-actions bot added this to the 1.73.x - Nightly milestone Oct 30, 2024
@brave-builds
Copy link
Collaborator

Released in v1.73.62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build feature/web3/wallet/core feature/web3/wallet puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build out Shield ZCash Account Modal
6 participants