Skip to content

Conversation

@cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Sep 9, 2025

Explanation

This PR migrates MultichainNetworkController to the new @metamask/messenger message bus, as opposed to the one exported from @metamask/base-controller.

References

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

Migrates MultichainNetworkController to the new @metamask/messenger, updates types/imports to @metamask/base-controller/next, renames metadata flag, and refactors tests and deps accordingly.

  • MultichainNetworkController:
    • Migrate from RestrictedMessenger to new Messenger (@metamask/messenger), replacing messagingSystem.* with messenger.* calls.
    • Register/subscribe via messenger.registerActionHandler and messenger.subscribe; publish MultichainNetworkController:networkDidChange via new messenger.
  • Types/Constants:
    • Switch imports to @metamask/base-controller/next.
    • Update MultichainNetworkControllerMessenger type to use Messenger and adjust allowed actions/events.
    • Rename metadata property anonymous to includeInDebugSnapshot in MULTICHAIN_NETWORK_CONTROLLER_METADATA and tests.
  • Tests:
    • Refactor to construct root/child messengers (MOCK_ANY_NAMESPACE, delegate) and update spies/mocks accordingly.
  • Dependencies/Docs:
    • Add @metamask/messenger dependency in package.json and reflect in README dependency graph.
    • Update changelog with breaking changes.

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

mcmire
mcmire previously approved these changes Sep 10, 2025
@FrederikBolding FrederikBolding added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit 320f696 Oct 27, 2025
256 of 257 checks passed
@FrederikBolding FrederikBolding deleted the cryptodev-2s/messenger/multichain-network-controller branch October 27, 2025 13:00
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.

5 participants