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

Use addNewAccount from core KeyringController #19814

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Jun 29, 2023

Explanation

This PR uses addNewAccount from core KeyringController instead of calling EthKeyringController directly. As addNewAccount from KeyringController does not automatically select the added account, it is now selected by the client after the account creation.

Manual Testing Steps

  • Adding a new HD account should work as before.
  • When adding a new account, the created account should be selected as before.

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
Copy link
Contributor

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.

@metamaskbot
Copy link
Collaborator

Builds ready [cf0fb2a]
Page Load Metrics (1585 ± 39 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint100139118115
domContentLoaded1452170415587536
load1453171915858139
domInteractive1452170415577536
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 156569 bytes
  • ui: -6418 bytes
  • common: 6356 bytes

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #19814 (614a366) into develop (6512cac) will decrease coverage by 0.04%.
The diff coverage is 80.00%.

❗ Current head 614a366 differs from pull request most recent head 275037f. Consider uploading reports for the commit 275037f to get more accurate results

@@             Coverage Diff             @@
##           develop   #19814      +/-   ##
===========================================
- Coverage    68.70%   68.66%   -0.04%     
===========================================
  Files          990      991       +1     
  Lines        38289    38273      -16     
  Branches     10262    10258       -4     
===========================================
- Hits         26304    26278      -26     
- Misses       11985    11995      +10     
Files Changed Coverage Δ
app/scripts/metamask-controller.js 64.55% <66.67%> (-0.99%) ⬇️
ui/store/actions.ts 43.42% <100.00%> (-0.04%) ⬇️

... and 9 files with indirect coverage changes

@mikesposito mikesposito force-pushed the refactor/use-core-keyring-controller branch 5 times, most recently from c65c6b9 to 2d584d7 Compare July 19, 2023 09:37
@mikesposito
Copy link
Member Author

Depends on #19659

@mikesposito mikesposito force-pushed the refactor/use-core-keyring-controller branch 2 times, most recently from 95313e3 to 1567ae0 Compare July 24, 2023 10:32
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from cf0fb2a to fe58431 Compare July 24, 2023 11:54
@mikesposito
Copy link
Member Author

Fitness Functions CI is failing on this rule:

Checking rule "Don't use sinonorassert in unit tests"

It should be a false positive as we are not adding new test cases

Base automatically changed from refactor/use-core-keyring-controller to develop July 24, 2023 18:44
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from fe58431 to 722c683 Compare July 24, 2023 22:24
@mikesposito mikesposito marked this pull request as ready for review July 24, 2023 22:51
@mikesposito mikesposito requested a review from a team as a code owner July 24, 2023 22:51
@metamaskbot
Copy link
Collaborator

Builds ready [722c683]
Page Load Metrics (1502 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint105167125178
domContentLoaded1360164815027636
load1360164815027636
domInteractive1360164815027636
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -498 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [f271edb]
Page Load Metrics (1770 ± 100 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1072881574120
domContentLoaded14842114177020799
load148421141770207100
domInteractive14842114177020799
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -448 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

app/scripts/metamask-controller.js Show resolved Hide resolved
app/scripts/metamask-controller.js Outdated Show resolved Hide resolved
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch 3 times, most recently from 500075f to 58686ae Compare July 31, 2023 09:11
@metamaskbot
Copy link
Collaborator

Builds ready [2abdb29]
Page Load Metrics (1735 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1261981602110
domContentLoaded15381977173513464
load15381978173513464
domInteractive15381977173513464
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -383 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 2abdb29 to a95471b Compare July 31, 2023 14:30
@metamaskbot
Copy link
Collaborator

Builds ready [a95471b]
Page Load Metrics (1667 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1221961452010
domContentLoaded15311962166610550
load15311962166710450
domInteractive15311962166610550

mcmire
mcmire previously approved these changes Jul 31, 2023
Copy link
Contributor

@mcmire mcmire 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!

@mcmire
Copy link
Contributor

mcmire commented Jul 31, 2023

Oh, looks like conflicts :(

Now that I've commented, I can keep an eye on this one better.

@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from a95471b to 9529284 Compare August 1, 2023 11:02
mcmire
mcmire previously approved these changes Aug 1, 2023
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 9529284 to 28a260c Compare August 2, 2023 11:57
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 28a260c to 81e752f Compare August 3, 2023 08:18
@metamaskbot
Copy link
Collaborator

Builds ready [81e752f]
Page Load Metrics (1496 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint102173125189
domContentLoaded1411173314969043
load1411173314969043
domInteractive1411173314969043
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -387 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 81e752f to 0de0244 Compare August 14, 2023 08:08
@metamaskbot
Copy link
Collaborator

Builds ready [0de0244]
Page Load Metrics (1663 ± 65 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1072141482412
domContentLoaded14402050166213665
load14582051166313465
domInteractive14402050166213665
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -387 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

cryptodev-2s
cryptodev-2s previously approved these changes Aug 14, 2023
Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 0de0244 to 722b37f Compare August 14, 2023 14:44
@metamaskbot
Copy link
Collaborator

Builds ready [722b37f]
Page Load Metrics (1640 ± 58 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint107162138157
domContentLoaded13771914163911957
load13771915164012058
domInteractive13771914163911957
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -387 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@mikesposito mikesposito dismissed stale reviews from cryptodev-2s and mcmire via a93cdf7 August 14, 2023 15:28
@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 722b37f to a93cdf7 Compare August 14, 2023 15:28
@Gudahtt Gudahtt force-pushed the refactor/use-addnewaccount-from-core branch from a93cdf7 to 614a366 Compare August 15, 2023 19:31
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [614a366]
Page Load Metrics (1557 ± 53 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1101951382311
domContentLoaded14061788155711153
load14061788155711153
domInteractive14061788155711153
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -419 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@mikesposito mikesposito force-pushed the refactor/use-addnewaccount-from-core branch from 614a366 to 275037f Compare August 16, 2023 08:16
@mikesposito mikesposito merged commit 42d05ef into develop Aug 16, 2023
@mikesposito mikesposito deleted the refactor/use-addnewaccount-from-core branch August 16, 2023 09:19
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Aug 16, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [275037f]
Page Load Metrics (1469 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint106176127189
domContentLoaded1330173714699043
load1330173714699043
domInteractive1330173714699043
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -419 Bytes (-0.01%)
  • ui: -62 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@Gudahtt Gudahtt added release-11.1.0 Issue or pull request that will be included in release 11.1.0 and removed release-10.36.0 Issue or pull request that will be included in release 10.36.0 labels Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.1.0 Issue or pull request that will be included in release 11.1.0 team-wallet-framework
Projects
None yet
5 participants