Skip to content

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Sep 29, 2025

This PR migrates SwapsController to new @metamask/messenger instead of @metamask/base-controller. This is part of a larger effort to migrate all controllers to use @metamask/messenger.


Note

Replace base-controller RestrictedMessenger usage with @metamask/messenger, update controller/test wiring, and align metadata/debug flags.

  • Controller (src/SwapsController.ts)
    • Switch to @metamask/base-controller/next and @metamask/messenger APIs.
    • Replace messagingSystem calls with messenger (registerActionHandler, subscribe, call).
    • Update state metadata keys from anonymous to includeInDebugSnapshot.
  • Types (src/types.ts)
    • Change SwapsControllerMessenger to use @metamask/messenger.
  • Tests (src/SwapsController.test.ts)
    • Refactor to new @metamask/messenger (Messenger, namespaces, delegation) and adjust imports.
    • Update deriveStateFromMetadata usage to includeInDebugSnapshot.
  • Dependencies
    • Bump @metamask/base-controller to ^8.0.4 and add @metamask/messenger ^0.3.0.

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

@mikesposito mikesposito requested a review from a team as a code owner September 29, 2025 09:46
Copy link

socket-security bot commented Sep 29, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​messenger@​0.2.0 ⏵ 0.3.0100 +110076 +190 -1100
Updated@​metamask/​base-controller@​8.3.0 ⏵ 8.4.01001007793 -1100

View full report

mcmire
mcmire previously approved these changes Oct 8, 2025
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire dismissed their stale review October 8, 2025 19:51

Hmm, looks like CI is failing.

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.

Replace RestrictedMessenger with delegated Messenger

2 participants