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(btc): add BTC account creation menu entry #25625

Merged
merged 31 commits into from
Jul 10, 2024

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Jul 2, 2024

Description

This adds a new menu entry "Create a new Bitcoin account" to create a Bitcoin account using the Bitcoin Manager Snap.

Note

This new feature is only available on Flask for now.

Warning

Some code logic of this PR might change depending if we are able to reduce the e2e test flakiness from this PR:

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/451

Manual testing steps

Main build

  1. yarn start
  2. Click on the account (in the app header)
  3. Click "Add account or hardware wallet"
  4. You should not see anything related to Bitcoin account creation

Screenshot 2024-07-02 at 11 45 22

Flask build

  1. yarn start
  2. Click on the account (in the app header)
  3. Click "Add account or hardware wallet"
  4. Click "Create a new Bitcoin account"
  5. Input your account name
  6. You should now see your new Bitcoin account in the extension

Screenshot 2024-07-02 at 11 53 17
Screenshot 2024-07-02 at 11 54 12
Screenshot 2024-07-02 at 11 54 25
Screenshot 2024-07-02 at 11 54 31

Screenshots/Recordings

Before

After

Screenshot 2024-07-02 at 11 45 22
Screenshot 2024-07-02 at 11 53 17
Screenshot 2024-07-02 at 11 54 12
Screenshot 2024-07-02 at 11 54 25
Screenshot 2024-07-02 at 11 54 31

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

github-actions bot commented Jul 2, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@ccharly ccharly force-pushed the feature/create-btc-account-without-snap-flow branch from 68f81e7 to 2ab28e7 Compare July 2, 2024 10:08
@ccharly ccharly force-pushed the feature/create-btc-account-without-snap-flow branch from 91b06a0 to f2ffffe Compare July 2, 2024 13:04
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 73.91304% with 12 lines in your changes missing coverage. Please review.

Project coverage is 69.77%. Comparing base (5ee57a6) to head (716861e).
Report is 19 commits behind head on develop.

Files Patch % Lines
.../multichain/account-list-menu/account-list-menu.js 54.17% 11 Missing ⚠️
ui/store/actions.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25625      +/-   ##
===========================================
- Coverage    69.77%   69.77%   -0.01%     
===========================================
  Files         1376     1378       +2     
  Lines        48403    48534     +131     
  Branches     13348    13383      +35     
===========================================
+ Hits         33773    33860      +87     
- Misses       14630    14674      +44     

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

@gantunesr gantunesr marked this pull request as ready for review July 2, 2024 13:28
@gantunesr gantunesr requested review from a team as code owners July 2, 2024 13:28
@metamaskbot
Copy link
Collaborator

Builds ready [f2ffffe]
Page Load Metrics (241 ± 231 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint691641092211
domContentLoaded97930157
load401775241481231
domInteractive97930157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.95 KiB (0.06%)
  • common: 68 Bytes (0.00%)

@ccharly ccharly force-pushed the feature/create-btc-account-without-snap-flow branch from e9d3e26 to 7b0b10b Compare July 2, 2024 15:05
@ccharly ccharly force-pushed the feature/create-btc-account-without-snap-flow branch from fa1bc6d to 93d5ee5 Compare July 2, 2024 15:39
@metamaskbot
Copy link
Collaborator

Builds ready [93d5ee5]
Page Load Metrics (167 ± 168 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint89150115168
domContentLoaded118035178
load481691167350168
domInteractive118035178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.99 KiB (0.06%)
  • common: 68 Bytes (0.00%)

@montelaidev
Copy link
Contributor

Tested and the account creation with the preinstalled flask is working. The only issue is with the asset icon
Screenshot 2024-07-09 at 17 33 02

@ccharly ccharly force-pushed the feature/create-btc-account-without-snap-flow branch from 6765647 to fa37320 Compare July 9, 2024 16:11
@ccharly ccharly removed the request for review from a team July 10, 2024 09:14
@ccharly ccharly changed the title feat(btc): add BTC account creation menu entry + BTC preinstalled snap (Flask only) feat(btc): add BTC account creation menu entry Jul 10, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [ed06ecc]
Page Load Metrics (73 ± 9 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint64132100178
domContentLoaded96230157
load4210873199
domInteractive96230157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 521.34 KiB (7.46%)
  • common: 68 Bytes (0.00%)

@ccharly
Copy link
Contributor Author

ccharly commented Jul 10, 2024

Tested and the account creation with the preinstalled flask is working. The only issue is with the asset icon

@montelaidev Yes the asset icon is not showing during balance's loading (same behavior than for eth actually)

@gantunesr
Copy link
Member

@ccharly - If the account was already created, the button "Add new Bitcoin account" should be disabled. Once the account is deleted/removed, the button should be enabled again

Co-authored-by: Daniel Rocha <[email protected]>
@ccharly
Copy link
Contributor Author

ccharly commented Jul 10, 2024

@ccharly - If the account was already created, the button "Add new Bitcoin account" should be disabled. Once the account is deleted/removed, the button should be enabled again

@gantunesr yup, just implemented it here: 5a196a0

But I had to wait for other PRs to be merged! :)

Copy link

sonarcloud bot commented Jul 10, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [716861e]
Page Load Metrics (63 ± 9 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66153932110
domContentLoaded96324147
load3911563199
domInteractive96324147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 521.6 KiB (7.47%)
  • common: 75 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [716861e]
Page Load Metrics (63 ± 9 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66153932110
domContentLoaded96324147
load3911563199
domInteractive96324147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 521.6 KiB (7.47%)
  • common: 75 Bytes (0.00%)

@montelaidev
Copy link
Contributor

Tested again, and the menu entry is now disabled after the account creation.

@ccharly ccharly merged commit 059166b into develop Jul 10, 2024
73 checks passed
@ccharly ccharly deleted the feature/create-btc-account-without-snap-flow branch July 10, 2024 16:00
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants