Skip to content

Conversation

@V00D00-child
Copy link
Member

@V00D00-child V00D00-child commented Nov 3, 2025

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

  • 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

Note

Adds a pendingRevocations state with getter and lifecycle management tied to transaction events and timeout during revocation flow.

  • Controller:
    • State: Add pendingRevocations array to GatorPermissionsControllerState (default []); update metadata (includeInStateLogs, usedInUi, non-persistent).
    • API: New pendingRevocations getter; private helpers #addPendingRevocationToState and #removePendingRevocationFromState.
    • Behavior: addPendingRevocation now records pending item immediately, subscribes to transactionConfirmed/Failed/Dropped, removes pending on any terminal event or timeout, and submits revocation on confirm.
  • Tests:
    • Update state metadata snapshots to include pendingRevocations in logs/UI.
    • Initialize custom state with pendingRevocations: [] where needed; add test validating pendingRevocations getter.

Written by Cursor Bugbot for commit f2c2c8d. This will update automatically on new commits. Configure here.

hanzel98 and others added 13 commits November 3, 2025 13:25
- Add RevocationParams type with delegationHash field
- Add PermissionProviderSubmitRevocation RPC method enum
- Implement submitRevocation method with proper error handling
- Add comprehensive test suite with 100% coverage
- Export new types in public API

This enables MetaMask clients to submit permission revocations through
the gator permissions provider snap using the permissionsProvider_submitRevocation
RPC method.
@V00D00-child V00D00-child requested a review from a team as a code owner November 3, 2025 21:36
@V00D00-child V00D00-child requested a review from hanzel98 November 3, 2025 21:36
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Base automatically changed from chore/revokation-rpc-request to main November 4, 2025 18:53
@hanzel98 hanzel98 requested a review from a team as a code owner November 4, 2025 18:53
@V00D00-child
Copy link
Member Author

Replaced with #7055

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.

3 participants