-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
bump @metamask/assets-controllers
to ^13.0.0
#20916
bump @metamask/assets-controllers
to ^13.0.0
#20916
Conversation
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. |
Currently, TokenController only uses the global selected provider. We want to see how it feels making this controller consume any network provider the NetworkController may have available. We do this by extending the `addToken()` interface with an optional `networkClientId` param, but continuing to use the provider proxy as a fallback. ~~TODO: specs have not been updated to test the networkClientId case~~ added * Fixes MetaMask/MetaMask-planning#1020 * See MetaMask/metamask-extension#20916 ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? For example: * Fixes #12345 * Related to #67890 --> ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/assets-controllers` - **BREAKING**: `TokensController` now expects `getNetworkClientById` in constructor options - **BREAKING**: `TokensController. addToken()` now accepts a single options object ``` { address: string; symbol: string; decimals: number; name?: string; image?: string; interactingAddress?: string; networkClientId?: NetworkClientId; } ``` - **CHANGED**: `TokensController. addToken()` will use the chain ID value derived from state for `networkClientId` if provided - **CHANGED**: `TokensController. addTokens()` now accepts an optional `networkClientId` as the last parameter - **CHANGED**: `TokensController. addTokens()` will use the chain ID value derived from state for `networkClientId` if provided - **CHANGED**: `TokensController. watchAsset()` options now accepts optional `networkClientId` which is used to get the ERC-20 token name if provided ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
@metamaskbot update-policies |
Policies updated |
Builds ready [38512df]
Page Load Metrics (1077 ± 428 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [eaf661f]
Page Load Metrics (802 ± 448 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #20916 +/- ##
========================================
Coverage 68.58% 68.58%
========================================
Files 1013 1013
Lines 40614 40615 +1
Branches 10854 10858 +4
========================================
+ Hits 27854 27855 +1
Misses 12760 12760
☔ View full report in Codecov by Sentry. |
Builds ready [5557313]
Page Load Metrics (1236 ± 361 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [d773e0c]
Page Load Metrics (963 ± 373 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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
…1197) Fixes bug with TokensRateController no longer starting automatically on instantiation and requiring explicit `start()` to be called. Also replaces `configure({disabled})` with `start()` or `stop()` ## **Manual testing steps** * Open wallet * Check privacy settings to ensure price conversion is enabled * Restart wallet * Click send * Select ERC-20 token * Enter some amount * See that there is a conversion amount * Visit privacy settings and disable price conversion * Click send * Select ERC-20 token * Enter some amount * See that there is NO conversion amount ## **Screenshots/Recordings** _If applicable, add screenshots and/or recordings to visualize the before and after of your change._ ### **Before** ![image](https://github.com/MetaMask/metamask-extension/assets/918701/e595db79-276c-409e-894a-ae1dc5ce56cd) ### **After** ![Screenshot 2023-10-04 at 2 46 38 PM](https://github.com/MetaMask/metamask-extension/assets/918701/0c46e5bb-3dfb-4186-973d-e0f81ff2dd2f) ## **Related issues** Fixes #20916 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained: - [x] What problem this PR is solving. - [x] How this problem was solved. - [x] How reviewers can test my changes. - [x] I’ve indicated what issue this PR is linked to: Fixes #??? - [ ] I’ve included tests if applicable. - [ ] I’ve documented any added code. - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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.
…1197) Fixes bug with TokensRateController no longer starting automatically on instantiation and requiring explicit `start()` to be called. Also replaces `configure({disabled})` with `start()` or `stop()` ## **Manual testing steps** * Open wallet * Check privacy settings to ensure price conversion is enabled * Restart wallet * Click send * Select ERC-20 token * Enter some amount * See that there is a conversion amount * Visit privacy settings and disable price conversion * Click send * Select ERC-20 token * Enter some amount * See that there is NO conversion amount ## **Screenshots/Recordings** _If applicable, add screenshots and/or recordings to visualize the before and after of your change._ ### **Before** ![image](https://github.com/MetaMask/metamask-extension/assets/918701/e595db79-276c-409e-894a-ae1dc5ce56cd) ### **After** ![Screenshot 2023-10-04 at 2 46 38 PM](https://github.com/MetaMask/metamask-extension/assets/918701/0c46e5bb-3dfb-4186-973d-e0f81ff2dd2f) ## **Related issues** Fixes #20916 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained: - [x] What problem this PR is solving. - [x] How this problem was solved. - [x] How reviewers can test my changes. - [x] I’ve indicated what issue this PR is linked to: Fixes #??? - [ ] I’ve included tests if applicable. - [ ] I’ve documented any added code. - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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.
Explanation
Needed to help get us closer to phasing out a single globally selected network.
Bumps
@metamask/assets-controllers
to ^13.0.0 and passes networkClientId arg to newly updatedTokenController.addToken()
,TokenController.addTokens()
, andTokenController.watchAsset()
. Adopts changes in other asset-related controllersScreenshots/Screencaps
None. Should be no changes apparent to user.
Manual Testing Steps
Via Dapp API
Via Wallet UI
0xc18360217d8f7ab5e7c516566761ea12ce7f9d72
contract address for ENSPre-merge author checklist
Pre-merge reviewer checklist
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.