Skip to content

refactor: descriptive caip25CaveatBuilder unsupported scopes #5806

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

Merged

Conversation

wenfix
Copy link
Contributor

@wenfix wenfix commented May 14, 2025

Explanation

Currently the exception thrown by caip25CaveatBuilder validator doesn't reference the unsupported scopes that caused it. With this change we list all the scopes that failed validation on the exception message when throwing it.

References

Fixes https://github.com/MetaMask/MetaMask-planning/issues/4855

Changelog

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 communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@wenfix wenfix marked this pull request as ready for review May 14, 2025 17:49
@wenfix wenfix requested review from a team as code owners May 14, 2025 17:49
ffmcgee725
ffmcgee725 previously approved these changes May 15, 2025
Copy link
Member

@ffmcgee725 ffmcgee725 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

NIce work Alex! LGTM!

@adonesky1 adonesky1 merged commit ea74e53 into main Jun 12, 2025
218 checks passed
@adonesky1 adonesky1 deleted the refactor/caip25CaveatBuilder-unsupported-scope-exception branch June 12, 2025 16:43
@adonesky1 adonesky1 mentioned this pull request Jun 13, 2025
adonesky1 added a commit that referenced this pull request Jun 13, 2025
## @metamask/chain-agnostic-permission

## [0.7.1]

### Changed

- Bump `@metamask/keyring-internal-api` to `^6.2.0`
([#5871](#5871))
- Bump `@metamask/controller-utils` to `^11.10.0`
([#5935](#5935))
- Bump `@metamask/network-controller` to `^23.6.0`
([#5935](https://github.com/MetaMask/core/pull/5935),[#5882](https://github.com/MetaMask/core/pull/5882))
- Change `caip25CaveatBuilder` to list unsupported scopes in the
unsupported scopes error
([#5806](#5806))
### Fixed
- Fix `isInternalAccountInPermittedAccountIds` and
`isCaipAccountIdInPermittedAccountIds` to correctly handle comparison
against `permittedAccounts` values of the `wallet:<namespace>:<address>`
format ([#5980](#5980))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants