-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
refactor: Use selectors for core network state access #7121
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7121 +/- ##
==========================================
- Coverage 32.84% 32.52% -0.33%
==========================================
Files 1001 1001
Lines 26780 26776 -4
Branches 2118 2116 -2
==========================================
- Hits 8797 8708 -89
- Misses 17559 17649 +90
+ Partials 424 419 -5
☔ View full report in Codecov by Sentry. |
871e833
to
21c1980
Compare
Passing E2E smoke test run: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fd4f0927-b8f0-4c50-a772-50c307cc9154 |
Replace direct references to NetworkController state with selectors. Most of these examples were skipped in previous selector refactors because they were outside of a React context, so there was no established way to get the Redux state as input for the selector. We can now do that by importing the Redux store directly and calling `getState`. This relates to MetaMask/mobile-planning#1226
21c1980
to
cfceb7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment
The WalletConnect module has been updated to pass the full Redux state to the `selectChainId` selector, rather than just the background state. The background state was being passed in alone because it was left behind accidentally from an earlier version of this branch, from before the recent store refactors/TypeScript conversion.
Kudos, SonarCloud Quality Gate passed! 0 Bugs 42.9% Coverage The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Development & PR Process
release-xx
label to identify the PR slated for a upcoming release (will be used in release discussion)needs-dev-review
label when work is completedneeds-qa
: PR requires manual QA.No QA/E2E only
: PR does not require any manual QA effort. Prior to merging, ensure that you have successful end-to-end test runs in Bitrise.Spot check on release build
: PR does not require feature QA but needs non-automated verification. In the description section, provide test scenarios. Add screenshots, and or recordings of what was tested.QA Passed
label when QA has signed off (Only required if the PR was labeled withneeds-qa
)team-
(orexternal-contributor
label if your not a MetaMask employee)Description
Replace direct references to NetworkController state with selectors. Most of these examples were skipped in previous selector refactors because they were outside of a React context, so there was no established way to get the Redux state as input for the selector. We can now do that by importing the Redux store directly and calling
getState
.Issue
This relates to https://github.com/MetaMask/mobile-planning/issues/1226
Checklist