Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MetaMask/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @metamask/keyring-controller@9.0.0
Choose a base ref
...
head repository: MetaMask/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @metamask/keyring-controller@10.0.0
Choose a head ref
  • 13 commits
  • 133 files changed
  • 11 contributors

Commits on Nov 17, 2023

  1. 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>
    Gudahtt and MajorLift authored Nov 17, 2023
    Configuration menu
    Copy the full SHA
    410e782 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b47aec4 View commit details
    Browse the repository at this point in the history
  3. Integrate PollingController into TokenRatesController (#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>
    jiexi and adonesky1 authored Nov 17, 2023
    Configuration menu
    Copy the full SHA
    5a8639f View commit details
    Browse the repository at this point in the history
  4. [base-controller] Add RestrictedControllerMessenger tests 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>
    MajorLift and mcmire authored Nov 17, 2023
    Configuration menu
    Copy the full SHA
    bb7f605 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2023

  1. Configuration menu
    Copy the full SHA
    6822b6f View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Add transaction-status-update event (#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
    OGPoyraz authored Nov 21, 2023
    Configuration menu
    Copy the full SHA
    fb98de9 View commit details
    Browse the repository at this point in the history
  2. Add wallet_revokePermissions RPC 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>
    3 people authored Nov 21, 2023
    Configuration menu
    Copy the full SHA
    77a7e38 View commit details
    Browse the repository at this point in the history
  3. Add updateEditableParams in 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.
    vinistevam authored Nov 21, 2023
    Configuration menu
    Copy the full SHA
    f23ad0b View commit details
    Browse the repository at this point in the history
  4. Fix main branch CI failure by increasing jest testTimeout option (#…

    …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
    MajorLift authored Nov 21, 2023
    Configuration menu
    Copy the full SHA
    7dfc07b View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. 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.
    matthewwalsh0 authored Nov 22, 2023
    Configuration menu
    Copy the full SHA
    9c6e19d View commit details
    Browse the repository at this point in the history
  2. Deprecate BaseControllerV1 and use BaseControllerV2 as 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>
    MajorLift and mcmire authored Nov 22, 2023
    Configuration menu
    Copy the full SHA
    be55ceb View commit details
    Browse the repository at this point in the history
  3. [base-controller] Enforce that RestrictedControllerMessenger is 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>
    MajorLift and mcmire authored Nov 22, 2023
    Configuration menu
    Copy the full SHA
    fda4269 View commit details
    Browse the repository at this point in the history
  4. Release 93.0.0 (#2063)

    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>
    3 people authored Nov 22, 2023
    Configuration menu
    Copy the full SHA
    f1c3042 View commit details
    Browse the repository at this point in the history
Loading