-
-
Notifications
You must be signed in to change notification settings - Fork 276
Comparing changes
Open a pull request
base repository: MetaMask/core
base: @metamask/keyring-controller@9.0.0
head repository: MetaMask/core
compare: @metamask/keyring-controller@10.0.0
- 13 commits
- 133 files changed
- 11 contributors
Commits on Nov 17, 2023
-
feat(base-controller): Allow using internal events/actions (#2050)
## Explanation The restricted controller messenger now allows using all internal events and actions. Previously internal events were treated the same as external events, they had to be explicitly allowed. This is a non-breaking change; internal actions/events are still permitted to be list as "allowed", it's just no longer necessary. ## References Resolves #2047 ## Changelog ### `@metamask/base-controller` - CHANGED: The restricted controller messenger now allows calling all internal events and actions - Previously internal events and actions were only usable if they were listed as "allowed". They are still permitted to be listed as "allowed" now, but it is no longer necessary. ## 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 --------- Co-authored-by: Jongsun Suh <jongsun.suh@icloud.com>
Configuration menu - View commit details
-
Copy full SHA for 410e782 - Browse repository at this point
Copy the full SHA 410e782View commit details -
Configuration menu - View commit details
-
Copy full SHA for b47aec4 - Browse repository at this point
Copy the full SHA b47aec4View commit details -
Integrate
PollingControllerintoTokenRatesController(#2015)## Explanation Integrates `PollingController` into `TokensRatesController`, keeping as much of the current method interfaces intact. Needed for eventual multichain support. ## References Fixes: MetaMask/MetaMask-planning#1122 ## 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**: `TokenRatesController` constructor params now requires `getNetworkClientById` - **ADDED**: `TokenRatesController` state now has `contractExchangeRatesByChainId` property which an object keyed by `chainId` and `nativeCurrency` - `tokenRatesController.state.contractExchangeRatesByChainId[chainId][nativeCurrency]` - **ADDED**: `TokenRatesController` constructor params now accepts optional `interval` and `threshold` - **ADDED**: Add `updateExchangeRatesByChainId`, `_executePoll`, `startPollingByNetworkClientId`, `stopAllPolling`, and `stopPollingByPollingToken` methods to `TokenRatesController` - **CHANGED**: `TokenRatesController.fetchExchangeRate()` now accepts an optional `tokenAddresses` as the last parameter - **CHANGED**: `TokenRatesController.getChainSlug()` now accepts an optional `tokenAddresses` parameter - **CHANGED**: `TokenRatesController.fetchAndMapExchangeRates()` now accepts an optional `tokenAddresses` as the last parameter ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate --------- Co-authored-by: Alex Donesky <adonesky@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5a8639f - Browse repository at this point
Copy the full SHA 5a8639fView commit details -
[
base-controller] AddRestrictedControllerMessengertests for run……time error handling (#2058) ## Explanation - Previously, error handling branches for `RestrictedControllerMessenger` methods were not being tested on the basis of compile-time checks: "Branches unreachable with valid types". - However, given that these methods are being called by our JavaScript clients, we also need assurances on runtime error-handling behavior. - This PR adds jest tests for the previously ignored error handling branches: coverage is brought up to 100%. - `@ts-expect-error` is used to suppress the compile-time type errors to simulate a JavaScript environment. ## References - Closes #2059 - See #2051 (comment) ## Changelog ### `@metamask/base-controller` ## 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 --------- Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for bb7f605 - Browse repository at this point
Copy the full SHA bb7f605View commit details
Commits on Nov 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 6822b6f - Browse repository at this point
Copy the full SHA 6822b6fView commit details
Commits on Nov 21, 2023
-
Add
transaction-status-updateevent (#2027)## 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? --> This PR adds a `transaction-status-update` event which gets emitted on status update on transaction meta. ## 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 --> #Fixes (task will be converted to issue soon) ## 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/transaction-controller` - **Added**: Added `transaction-status-update` event ## 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
Configuration menu - View commit details
-
Copy full SHA for fb98de9 - Browse repository at this point
Copy the full SHA fb98de9View commit details -
Add
wallet_revokePermissionsRPC method (#1889)## Explanation Adds a `wallet_revokePermissions` RPC method that can be used to revoke permissions that a subject has been granted in the PermissionController. This initial version does not support revoking caveats and will revoke the entire requested permission key. ## 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/permission-controller` - **Added**: Added `wallet_revokePermissions` RPC method ## 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 --------- Co-authored-by: Shane <jonas.shane@gmail.com> Co-authored-by: Alex Donesky <adonesky@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 77a7e38 - Browse repository at this point
Copy the full SHA 77a7e38View commit details -
Add
updateEditableParamsin Transaction Controller (#2056)## Explanation This PR adds an `updateEditableParams` method which allows the clients to update specific properties in the `TransactionParams` ### `@metamask/transaction-controller` - **ADDED**: `updateEditableParams` method to allow clients to update specific transaction parameters.
Configuration menu - View commit details
-
Copy full SHA for f23ad0b - Browse repository at this point
Copy the full SHA f23ad0bView commit details -
Fix main branch CI failure by increasing jest
testTimeoutoption (#……2074) ## Explanation - Fixes main branch CI failure: https://github.com/MetaMask/core/actions/runs/6944013982/job/18901645361 - Increases jest `testTimeout` option from default of 5000 to 30000. ## References - Closes #2075 ## Changelog N/A ## 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
Configuration menu - View commit details
-
Copy full SHA for 7dfc07b - Browse repository at this point
Copy the full SHA 7dfc07bView commit details
Commits on Nov 22, 2023
-
Add method to get transactions (#2065)
Re-add initApprovals method to allow client to finish initialisation before creating approvals. Remove unnecessary gas property update during initialisation since transactions are not added to the state until gas properties are updated. Normalise the gas fee values provided to speedUpTransaction and stopTransaction to support the extension arguments. Update the transaction after the afterSign hook to persist any updated properties. Report success to the result callback after publish is skipped to unblock the UI during the MMI flows. Set the value parameter to 0x0 if not specified. Limit properties updated by updateCustodianTransaction so it can initially be used for hash and status updates only, with more general MMI updates continuing to use updateTransaction. Align nonce logic with mobile. Update post transaction balance of swaps transactions after internal transactions.
Configuration menu - View commit details
-
Copy full SHA for 9c6e19d - Browse repository at this point
Copy the full SHA 9c6e19dView commit details -
Deprecate
BaseControllerV1and useBaseControllerV2as default (#……2078) ## Motivation The controller-messenger pattern implemented by `BaseControllerV2` is intended to be used by all of our controllers. Currently, the default `BaseController` name points to the older base controller implementation, which needs to be deprecated and only used for temporary backwards compatibility while all controllers are brought up-to-date. ## Explanation In this commit, we export `BaseControllerV2` as the default `BaseController`, and add a `@deprecated` tsdoc tag to the old `BaseController` class as well as export it under the new name `BaseControllerV1` to discourage future usage. This aligns with the `PollingController` naming scheme, where the up-to-date version is the default, and outdated mixins are named with qualifiers (`PollingControllerOnly`, `PollingControllerV1`). ## Impact Existing controller classes in core that extend from the old base controller are not affected — they now simply extend from `BaseControllerV1` instead of `BaseController`. External packages will need to update any instances of `extends BaseController` to `extends BaseControllerV1` and `extends BaseControllerV2` to `extends BaseController`, along with accompanying changes to import statements. --------- Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for be55ceb - Browse repository at this point
Copy the full SHA be55cebView commit details -
[
base-controller] Enforce thatRestrictedControllerMessengeris n……ot initialized with internal actions/events in allow lists (#2051) ## Explanation - `RestrictedControllerMessenger` constructor and `ControllerMessenger.getRestricted()` method now raise a type error if an internal action is passed into `allowedActions`, or an internal event into `allowedEvents`. - ` Type 'string' is not assignable to type 'never'.` - `Type '"SomeController:internalAction"' is not assignable to type '"OtherController:externalAction1" | "OtherController:externalAction2"'.` - Fixes breaking tests in downstream controllers in core repo. ## Impact - The `allowed{Actions,Events}` arrays in `ControllerMessenger.getRestricted()` now align with the `Allowed{Actions,Events}` generic params of `RestrictedControllerMessenger`: Both only enumerate external actions/events. - This commit disallows `allowed{Actions,Events}` arrays that contain an incomplete list of internal actions/events. - A partial list doesn't provide any useful information as all internal actions/events will be available to the messenger regardless of whether any of them are allowlisted. - A partial list also gives the confusing impression that some internal actions/events can be *disallowed* through omission, which is not true as of #2050. --------- Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for fda4269 - Browse repository at this point
Copy the full SHA fda4269View commit details -
This release primarily features backward-incompatible type fixes and changes to the messenger types in `base-controller`. As a result, all of the controllers are being bumped. --------- Co-authored-by: Jongsun Suh <jongsun.suh@icloud.com> Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Configuration menu - View commit details
-
Copy full SHA for f1c3042 - Browse repository at this point
Copy the full SHA f1c3042View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff @metamask/keyring-controller@9.0.0...@metamask/keyring-controller@10.0.0