Skip to content

Commit

Permalink
chore: Update @metamask/gas-fee-controller and peer deps (#28745)
Browse files Browse the repository at this point in the history
## **Description**

Update the `@metamask/gas-fee-controller` package to v21 to satisfy the
peer dependency on `@metamask/network-controller@^21.0.0`, and update
the `@metamask/user-operation-controller` to satisfy its peer dependency
upon `@metamask/gas-fee-controller`.

Note that an older version of `@metamask/gas-fee-controller` (v18)
remains in the dependency tree, but only because it's imported by
`@metamask/smart-transaction-controller` for type reasons. It has no
runtime impact on the application, so the associated peer dependency
warnings from this older release can be ignored. This will be eliminated
soon, in an upcoming PR.

The updated `@metamask/user-operation-controller` still does not have
its peer dependencies satisfied, but the problems are pre-existing. The
`@metamask/keyring-controller` and `@metamask/transaction-controller`
packages are head of where this package expects them to be. This is not
made worse by this PR though, and will be addressed in a future PR.

Changelogs:
- `@metamask/gas-fee-controller@21`:
https://github.com/MetaMask/core/blob/main/packages/gas-fee-controller/CHANGELOG.md#2100
  - One breaking change with an impact:
>The inherited AbstractPollingController method
startPollingByNetworkClientId has been renamed to startPolling
(MetaMask/core#4752)
- `@metamask/user-operation-controller@16`:
https://github.com/MetaMask/core/blob/main/packages/user-operation-controller/CHANGELOG.md#1600
- No breaking changes with an impact. It appeared at first that the
`startPollingByNetworkClientId` was breaking, but the user operation
controller had an override for that method so it was preserved ([see
here](https://github.com/MetaMask/core/pull/4752/files#diff-335af05ece636eb593b348e369dff139dfbfea49ad4e9ba3bb47b4909aab9aefR304))

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28745?quickstart=1)

## **Related issues**

Related to MetaMask/MetaMask-planning#3568

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [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)).
Not required for external contributors.

## **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.

---------

Co-authored-by: MetaMask Bot <[email protected]>
  • Loading branch information
Gudahtt and metamaskbot authored Nov 26, 2024
1 parent 3f574c4 commit 27763f5
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 238 deletions.
3 changes: 1 addition & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4146,8 +4146,7 @@ export default class MetamaskController extends EventEmitter {
),

// GasFeeController
gasFeeStartPollingByNetworkClientId:
gasFeeController.startPollingByNetworkClientId.bind(gasFeeController),
gasFeeStartPolling: gasFeeController.startPolling.bind(gasFeeController),
gasFeeStopPollingByPollingToken:
gasFeeController.stopPollingByPollingToken.bind(gasFeeController),

Expand Down
69 changes: 20 additions & 49 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1439,22 +1439,14 @@
"uuid": true
}
},
"@metamask/gas-fee-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/gas-fee-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/gas-fee-controller>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down Expand Up @@ -2637,13 +2629,13 @@
"@ethersproject/providers": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/gas-fee-controller": true,
"@metamask/metamask-eth-abis": true,
"@metamask/name-controller>async-mutex": true,
"@metamask/network-controller": true,
"@metamask/smart-transactions-controller>@metamask/base-controller": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/nonce-tracker": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/rpc-errors": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/utils": true,
Expand Down Expand Up @@ -2684,6 +2676,20 @@
"webpack>events": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": {
"globals": {
"clearInterval": true,
"console.error": true,
"setInterval": true
},
"packages": {
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/smart-transactions-controller>@metamask/polling-controller": true,
"bn.js": true,
"uuid": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/nonce-tracker": {
"packages": {
"@ethersproject/providers": true,
Expand Down Expand Up @@ -3023,62 +3029,33 @@
"fetch": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/gas-fee-controller": true,
"@metamask/rpc-errors": true,
"@metamask/transaction-controller": true,
"@metamask/user-operation-controller>@metamask/base-controller": true,
"@metamask/user-operation-controller>@metamask/polling-controller": true,
"@metamask/user-operation-controller>@metamask/rpc-errors": true,
"@metamask/user-operation-controller>@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true,
"bn.js": true,
"lodash": true,
"superstruct": true,
"uuid": true,
"webpack>events": true
}
},
"@metamask/user-operation-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/user-operation-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"@metamask/user-operation-controller>@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/user-operation-controller>@metamask/rpc-errors": {
"packages": {
"@metamask/rpc-errors>fast-safe-stringify": true,
"@metamask/user-operation-controller>@metamask/rpc-errors>@metamask/utils": true
}
},
"@metamask/user-operation-controller>@metamask/rpc-errors>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/user-operation-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down Expand Up @@ -5668,12 +5645,6 @@
"string.prototype.matchall>get-intrinsic": true
}
},
"superstruct": {
"globals": {
"console.warn": true,
"define": true
}
},
"terser>source-map-support>buffer-from": {
"packages": {
"browserify>buffer": true
Expand Down
69 changes: 20 additions & 49 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1439,22 +1439,14 @@
"uuid": true
}
},
"@metamask/gas-fee-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/gas-fee-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/gas-fee-controller>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down Expand Up @@ -2637,13 +2629,13 @@
"@ethersproject/providers": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/gas-fee-controller": true,
"@metamask/metamask-eth-abis": true,
"@metamask/name-controller>async-mutex": true,
"@metamask/network-controller": true,
"@metamask/smart-transactions-controller>@metamask/base-controller": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/nonce-tracker": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/rpc-errors": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/utils": true,
Expand Down Expand Up @@ -2684,6 +2676,20 @@
"webpack>events": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": {
"globals": {
"clearInterval": true,
"console.error": true,
"setInterval": true
},
"packages": {
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/smart-transactions-controller>@metamask/polling-controller": true,
"bn.js": true,
"uuid": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/nonce-tracker": {
"packages": {
"@ethersproject/providers": true,
Expand Down Expand Up @@ -3023,62 +3029,33 @@
"fetch": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/gas-fee-controller": true,
"@metamask/rpc-errors": true,
"@metamask/transaction-controller": true,
"@metamask/user-operation-controller>@metamask/base-controller": true,
"@metamask/user-operation-controller>@metamask/polling-controller": true,
"@metamask/user-operation-controller>@metamask/rpc-errors": true,
"@metamask/user-operation-controller>@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true,
"bn.js": true,
"lodash": true,
"superstruct": true,
"uuid": true,
"webpack>events": true
}
},
"@metamask/user-operation-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/user-operation-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"@metamask/user-operation-controller>@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/user-operation-controller>@metamask/rpc-errors": {
"packages": {
"@metamask/rpc-errors>fast-safe-stringify": true,
"@metamask/user-operation-controller>@metamask/rpc-errors>@metamask/utils": true
}
},
"@metamask/user-operation-controller>@metamask/rpc-errors>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/user-operation-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down Expand Up @@ -5668,12 +5645,6 @@
"string.prototype.matchall>get-intrinsic": true
}
},
"superstruct": {
"globals": {
"console.warn": true,
"define": true
}
},
"terser>source-map-support>buffer-from": {
"packages": {
"browserify>buffer": true
Expand Down
Loading

0 comments on commit 27763f5

Please sign in to comment.