You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Expose list of pending revocations in state (#7055)
## Explanation
Expose the list of pending revocations in the state to allow MM clients
to create custom selectors that filter on `pendingRevocations` to
determine whether the revoke CTA should show the "pending" status.
- A revocation is added to `pendingRevocations` state on calls to
`addPendingRevocation()`
- A revocation is removed from `pendingRevocations` state given a
`transactionId` when the handler's `cleanup()` function is executed.
## References
Forked from #6713
## 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 communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds `pendingRevocations` to controller state with lifecycle
management via `addPendingRevocation` and `submitRevocation`, updating
metadata, tests, and changelog.
>
> - **GatorPermissionsController**:
> - **State**: Add `pendingRevocations: { txId: string;
permissionContext: Hex }[]` with default `[]` and UI exposure in
metadata.
> - **API**:
> - New getter `pendingRevocations`.
> - `addPendingRevocation` now appends to state immediately and cleans
up on confirm/fail/drop/timeout by `txId`.
> - `submitRevocation` submits to Snap and removes entry by
`permissionContext` on success.
> - **Internals**: Add private helpers to add/remove pending
revocations; import `Hex` type.
> - **Tests**: Update snapshots, add coverage for pending revocations
lifecycle and getter.
> - **Docs**: Update `CHANGELOG.md` to note exposed pending revocations
and related actions.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
77e676e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments