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(multichain): add BalancesController #25257

Merged
merged 48 commits into from
Jun 21, 2024
Merged

Conversation

danroc
Copy link
Contributor

@danroc danroc commented Jun 12, 2024

Description

This PR adds the Balances Controller that retrieves non EVM balances of accounts.

Related issues

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

Manual testing steps

This tests requires a btc account for the balances to appear in the state

  1. Start the extension
  2. Create a non evm account
  3. Wait for interval to pass and see the balances in the state state.metamask.balances

Screenshots/Recordings

Not Applicable

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

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.

@montelaidev montelaidev changed the base branch from dr/bump-keyring-api to develop June 14, 2024 08:58
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

Project coverage is 64.99%. Comparing base (f327c95) to head (44f3878).
Report is 14 commits behind head on develop.

Files Patch % Lines
app/scripts/lib/accounts/Poller.ts 85.71% 2 Missing ⚠️
app/scripts/lib/accounts/BalancesController.ts 97.14% 1 Missing ⚠️
app/scripts/metamask-controller.js 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25257      +/-   ##
===========================================
+ Coverage    64.92%   64.99%   +0.07%     
===========================================
  Files         1390     1392       +2     
  Lines        55157    55182      +25     
  Branches     14493    14491       -2     
===========================================
+ Hits         35806    35862      +56     
+ Misses       19351    19320      -31     

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

@metamaskbot
Copy link
Collaborator

Builds ready [ddfc3f5]
Page Load Metrics (228 ± 253 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6711186136
domContentLoaded9231232
load411818228527253
domInteractive9231232
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.62 KiB (0.13%)
  • ui: 0 Bytes (0.00%)
  • common: 43 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [14ba8c6]
Page Load Metrics (48 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint65987984
domContentLoaded10191121
load41664873
domInteractive10191121
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.69 KiB (0.14%)
  • ui: 0 Bytes (0.00%)
  • common: 43 Bytes (0.00%)

app/scripts/lib/accounts/BalancesController.test.ts Outdated Show resolved Hide resolved
app/scripts/lib/accounts/BalancesController.ts Outdated Show resolved Hide resolved
app/scripts/lib/accounts/BalancesController.ts Outdated Show resolved Hide resolved
app/scripts/lib/accounts/BalancesController.ts Outdated Show resolved Hide resolved
ccharly
ccharly previously approved these changes Jun 21, 2024
gantunesr
gantunesr previously approved these changes Jun 21, 2024
@montelaidev montelaidev dismissed stale reviews from gantunesr and ccharly via 5172883 June 21, 2024 15:48
gantunesr
gantunesr previously approved these changes Jun 21, 2024
Copy link
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

As discussed together, we will to adapt the subscription logic in setupMultichainDataAndSubscriptions in another PR (for both the RatesController and BalancesController)

Other than that, LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [44f3878]
Page Load Metrics (41 ± 1 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62143792010
domContentLoaded712910
load37474121
domInteractive712910
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.7 KiB (0.14%)
  • ui: 0 Bytes (0.00%)
  • common: 43 Bytes (0.00%)

@ccharly ccharly merged commit a4dc9d3 into develop Jun 21, 2024
74 checks passed
@ccharly ccharly deleted the dr/balances-controller branch June 21, 2024 16:56
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants