Skip to content
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

Use @metamask/rpc-errors in approval-controller #1731

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Sep 27, 2023

Explanation

Related:

References

Changelog

@metamask/package-a

  • : Your change here
  • : Your change here

@metamask/package-b

  • : Your change here
  • : Your change here

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

OGPoyraz and others added 15 commits September 26, 2023 09:50
See change logs

---------

Co-authored-by: Alex Donesky <[email protected]>
Co-authored-by: Jiexi Luan <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
## Explanation

The `typedoc` package has been updated to match the version used by the
module template. This was done in preparation for updating the
TypeScript version used by the core monorepo as well. The current
version of `typedoc` we use doesn't support TypeScript v4.8.

The `typedoc-plugin-missing-exports` package required an update to
maintain compatibility with `typedoc`.

In both cases, none of the breaking changes affect our usage of the
package. Mostly they include improvements to the generated
documentation, and dropping support for older Node.js and TypeScript
versions.

`typedoc` changelog:
https://github.com/TypeStrong/typedoc/releases/tag/v0.23.0
`typedoc-plugin-missing-exports` changelog:
https://github.com/Gerrit0/typedoc-plugin-missing-exports/blob/main/CHANGELOG.md#0230-2022-06-26

## References

None

## 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
## 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?
-->

Including [1672](MetaMask#1672) to core
main repo.

## 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/transaction-controller`

- **ADDED**: Includ `transaction?.type` when normalising transaction.

## 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
## Explanation

> Originally was in MetaMask#1673 but
pulled out to get this in on its own.

Adds an abstract class (currently named `PollingController`. The start
and stop methods are parameterized by `networkClientId`'s and
`pollingToken`'s and polling intervals are stored in class variables by
`chainId` so that multiple `networkClients`/`chainIds` can poll
simultaneously. `executePoll` is an abstract method to be implemented by
the controller itself so that this pattern could be generalized and be
agnostic to what is being executed on the polling interval.


## References
Related to MetaMask#1673
Related to https://github.com/MetaMask/MetaMask-planning/issues/1314

---------

Co-authored-by: Alex Donesky <[email protected]>
## Explanation

The `AbortController` polyfill has not been required since updating to a
minimum Node.js version of v16 in MetaMask#1262. This API has been [built into
Node.js since
v15.4.0](https://nodejs.org/docs/latest-v16.x/api/globals.html#class-abortcontroller),
and is included in all versions of v16. It is also supported by [all
browsers that our extension
supports](https://developer.mozilla.org/en-US/docs/Web/API/AbortController#browser_compatibility),
and has been [supported by React Native since
v0.60.0](https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#v0600).

This helps unblock the TypeScript update to v4.8.4. The update resulted
in some type errors from this polyfill package.

## References
None

## Changelog

### `@metamask/assets-controllers`

### Removed
- **BREAKING:** Remove AbortController polyfill
  - This package now assumes that the AbortController global exists

## 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
Add onlyUpdateAfterDelay option to updateProposedNames method.
Add updateDelay to NameProviderSourceResult.
Add optional isEnabled callbacks to each NameProvider implementation.
Only update existing proposed names in state if the new value is not undefined.
@socket-security
Copy link

Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/keyring-controller 7.5.0...8.0.0 None +0/-0 140 kB metamaskbot
@metamask/network-controller 12.2.0...13.0.0 None +0/-0 217 kB metamaskbot
typedoc-plugin-missing-exports 0.22.6...0.23.0 None +50/-168 36.1 MB gerrit0
typedoc 0.22.18...0.23.28 None +25/-144 10.3 MB typedoc-bot

🚮 Removed packages: @metamask/[email protected], [email protected]

@legobeat legobeat requested a review from Mrtenz September 27, 2023 02:47
legobeat added a commit that referenced this pull request Oct 2, 2023
## Explanation

This replaces obsolete `eth-rpc-errors` with `@metamask/rpc-errors` in
`@metamask/approval-controller`. This should be coupled with #1639 and
can be merged before or after.

## References

#### Broken out from
- #1731 

#### Blocking
- #1724 

#### Related
- #1690

## Changelog


### `@metamask/approval-controller`

- **Changed**: Replaced `eth-rpc-errors` with `@metamask/rpc-errors`

### `@metamask/controller-utils`

- **Fixed**: Removed unused dependency `eth-rpc-errors`

## 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
@legobeat
Copy link
Contributor Author

legobeat commented Oct 2, 2023

Main thesis superseded by:

@legobeat legobeat closed this Oct 3, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

This replaces obsolete `eth-rpc-errors` with `@metamask/rpc-errors` in
`@metamask/approval-controller`. This should be coupled with #1639 and
can be merged before or after.

## References

#### Broken out from
- #1731 

#### Blocking
- #1724 

#### Related
- #1690

## Changelog


### `@metamask/approval-controller`

- **Changed**: Replaced `eth-rpc-errors` with `@metamask/rpc-errors`

### `@metamask/controller-utils`

- **Fixed**: Removed unused dependency `eth-rpc-errors`

## 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 pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

This replaces obsolete `eth-rpc-errors` with `@metamask/rpc-errors` in
`@metamask/approval-controller`. This should be coupled with #1639 and
can be merged before or after.

## References

#### Broken out from
- #1731 

#### Blocking
- #1724 

#### Related
- #1690

## Changelog


### `@metamask/approval-controller`

- **Changed**: Replaced `eth-rpc-errors` with `@metamask/rpc-errors`

### `@metamask/controller-utils`

- **Fixed**: Removed unused dependency `eth-rpc-errors`

## 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 pushed a commit that referenced this pull request Oct 12, 2023
## Explanation

This replaces obsolete `eth-rpc-errors` with `@metamask/rpc-errors` in
`@metamask/approval-controller`. This should be coupled with #1639 and
can be merged before or after.

## References

#### Broken out from
- #1731 

#### Blocking
- #1724 

#### Related
- #1690

## Changelog


### `@metamask/approval-controller`

- **Changed**: Replaced `eth-rpc-errors` with `@metamask/rpc-errors`

### `@metamask/controller-utils`

- **Fixed**: Removed unused dependency `eth-rpc-errors`

## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants