Skip to content

refactor: descriptive caip25CaveatBuilder unsupported scopes - #5806

Merged
adonesky1 merged 6 commits into
mainfrom
refactor/caip25CaveatBuilder-unsupported-scope-exception
Jun 12, 2025
Merged

refactor: descriptive caip25CaveatBuilder unsupported scopes #5806
adonesky1 merged 6 commits into
mainfrom
refactor/caip25CaveatBuilder-unsupported-scope-exception

Conversation

@wenfix

Copy link
Copy Markdown
Contributor

Explanation

Currently the exception thrown by caip25CaveatBuildervalidator 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

Fixeshttps://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 ownersMay 14, 2025 17:49
ffmcgee725
ffmcgee725 previously approved these changes May 15, 2025

@ffmcgee725ffmcgee725 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

Comment threadpackages/chain-agnostic-permission/CHANGELOG.md Outdated
Co-authored-by: jiexi <jiexiluan@gmail.com>

@adonesky1adonesky1 left a comment

Copy link
Copy Markdown
Contributor

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 mainJun 12, 2025
@adonesky1
adonesky1 deleted the refactor/caip25CaveatBuilder-unsupported-scope-exception branch June 12, 2025 16:43
@adonesky1adonesky1 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 freeto 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

@wenfix@jiexi@adonesky1@ffmcgee725