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

Update @metamask/json-rpc-engine and @metamask/utils #1724

Closed
wants to merge 4 commits into from

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Sep 26, 2023

Explanation

This bumps @metamask/json-rpc-engine (previously json-rpc-engine) and @metamask/utils to the latest versions. This is required to be able to use the latest versions of @metamask/json-rpc-engine and @metamask/eth-json-rpc-middleware in Snaps (MetaMask/snaps#1781).

The updated version of @metamask/json-rpc-engine is functionally equivalent to the previous version, but has improved types. To be able to bump it, it also required a bump of @metamask/utils.

Changelog

@metamask/accounts-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/address-book-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/approval-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/assets-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/base-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/controller-utils

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/ens-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/gas-fee-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/keyring-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/message-manager

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/network-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/notification-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/permission-controller

  • BREAKING: RestrictedMethodParameters no longer accepts void as type.
  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0
  • CHANGED: Bump @metamask/json-rpc-engine from ^6.1.0 to ^7.1.1

@metamask/signature-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

@metamask/transaction-controller

  • CHANGED: Bump @metamask/utils from ^6.2.0 to ^8.1.0

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

@Mrtenz Mrtenz requested review from a team as code owners September 26, 2023 10:44
@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 26, 2023

node_modules/@metamask/rpc-methods/dist/types/restricted/getLocale.d.ts(46,113): error TS2344: Type 'void' does not satisfy the constraint 'JsonRpcParams'.

Updating here requires @metamask/rpc-methods to be updated, but updating in @metamask/rpc-methods requires this to be updated... 😅

Solved this by patching @metamask/rpc-methods. We can remove the patch when that is updated.

package.json Outdated
Comment on lines 87 to 88
"@metamask/rpc-methods@^0.38.1-flask.1": "patch:@metamask/rpc-methods@npm%3A0.38.1-flask.1#./.yarn/patches/@metamask-rpc-methods-npm-0.38.1-flask.1-081e1eb5b3.patch",
"@metamask/rpc-methods@^1.0.1": "patch:@metamask/rpc-methods@npm%3A0.38.1-flask.1#./.yarn/patches/@metamask-rpc-methods-npm-0.38.1-flask.1-081e1eb5b3.patch"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@metamask/eth-snap-keyring and @metamask/keyring-api need to update the version of @metamask/snaps-controllers so we can dedupe this.

@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 26, 2023

Tests are failing because we're using eth-rpc-errors instead of @metamask/rpc-errors. Bumping this requires a bump in approval-controller, which is not possible, because:

TS2322: Type (value: Json | AddResult | PromiseLike<Json | AddResult>) => void is not assignable to type  ApprovalPromiseResolve 

And that can't be solved without changing the exactOptionalPropertyTypes option.

@legobeat
Copy link
Contributor

legobeat commented Sep 27, 2023

Tests are failing because we're using eth-rpc-errors instead of @metamask/rpc-errors. Bumping this requires a bump in approval-controller, which is not possible, because:

TS2322: Type (value: Json | AddResult | PromiseLike<Json | AddResult>) => void is not assignable to type  ApprovalPromiseResolve 

And that can't be solved without changing the exactOptionalPropertyTypes option.

Where do you see this error? Seems fine here:

@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 27, 2023

Tests are failing because we're using eth-rpc-errors instead of @metamask/rpc-errors. Bumping this requires a bump in approval-controller, which is not possible, because:

TS2322: Type (value: Json | AddResult | PromiseLike<Json | AddResult>) => void is not assignable to type  ApprovalPromiseResolve 

And that can't be solved without changing the exactOptionalPropertyTypes option.

Where do you see this error? Seems fine here:

I might've done something wrong then. 🤔 Thanks for looking into this!

@legobeat
Copy link
Contributor

@Mrtenz

Should unlock bumping @metamask/json-rpc-engine and remaing in updates in permission-controller here.

Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need rebase on main, though see note about parallel PRs with some overlapping changes to this one.

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

Superseded by #1749

@legobeat legobeat closed this Oct 19, 2023
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.

2 participants